@@ -773,7 +773,7 @@ int main(void) {
773773 led_state (PYB_LED_G1 , 1 );
774774
775775 // more sub-system init
776- sw_init ();
776+ switch_init ();
777777 storage_init ();
778778
779779 //usart_init(); disabled while wi-fi is enabled
@@ -822,7 +822,7 @@ int main(void) {
822822 rt_store_attr (m , qstr_from_str_static ("gc" ), rt_make_function_0 (pyb_gc ));
823823 rt_store_attr (m , qstr_from_str_static ("delay" ), rt_make_function_1 (pyb_delay ));
824824 rt_store_attr (m , qstr_from_str_static ("led" ), rt_make_function_1 (pyb_led ));
825- rt_store_attr (m , qstr_from_str_static ("switch" ), rt_make_function_0 ( pyb_sw ) );
825+ rt_store_attr (m , qstr_from_str_static ("switch" ), ( mp_obj_t ) & pyb_switch_obj );
826826 rt_store_attr (m , qstr_from_str_static ("servo" ), rt_make_function_2 (pyb_servo_set ));
827827 rt_store_attr (m , qstr_from_str_static ("pwm" ), rt_make_function_2 (pyb_pwm_set ));
828828 rt_store_attr (m , qstr_from_str_static ("accel" ), (mp_obj_t )& pyb_mma_read_obj );
@@ -848,10 +848,10 @@ int main(void) {
848848
849849 // check if user switch held (initiates reset of filesystem)
850850 bool reset_filesystem = false;
851- if (sw_get ()) {
851+ if (switch_get ()) {
852852 reset_filesystem = true;
853853 for (int i = 0 ; i < 50 ; i ++ ) {
854- if (!sw_get ()) {
854+ if (!switch_get ()) {
855855 reset_filesystem = false;
856856 break ;
857857 }
@@ -1122,7 +1122,7 @@ int main(void) {
11221122 data [2 ] = -2 ;
11231123 data [3 ] = 0 ;
11241124 for (;;) {
1125- if (sw_get ()) {
1125+ if (switch_get ()) {
11261126 data [0 ] = 0x01 ; // 0x04 is middle, 0x02 is right
11271127 } else {
11281128 data [0 ] = 0x00 ;
0 commit comments