@@ -343,12 +343,12 @@ STATIC bool init_sdcard_fs(void) {
343343
344344#if !MICROPY_HW_USES_BOOTLOADER
345345STATIC uint update_reset_mode (uint reset_mode ) {
346- #if MICROPY_HW_HAS_SWITCH
346+ #if MICROPY_HW_HAS_SWITCH
347347 if (switch_get ()) {
348348
349349 // The original method used on the pyboard is appropriate if you have 2
350350 // or more LEDs.
351- #if defined(MICROPY_HW_LED2 )
351+ #if defined(MICROPY_HW_LED2 )
352352 for (uint i = 0 ; i < 3000 ; i ++ ) {
353353 if (!switch_get ()) {
354354 break ;
@@ -376,7 +376,7 @@ STATIC uint update_reset_mode(uint reset_mode) {
376376 }
377377 mp_hal_delay_ms (400 );
378378
379- #elif defined(MICROPY_HW_LED1 )
379+ #elif defined(MICROPY_HW_LED1 )
380380
381381 // For boards with only a single LED, we'll flash that LED the
382382 // appropriate number of times, with a pause between each one
@@ -409,11 +409,11 @@ STATIC uint update_reset_mode(uint reset_mode) {
409409 }
410410 mp_hal_delay_ms (400 );
411411 }
412- #else
413- #error Need a reset mode update method
414- #endif
412+ #else
413+ #error Need a reset mode update method
414+ #endif
415415 }
416- #endif
416+ #endif
417417 return reset_mode ;
418418}
419419#endif
@@ -522,13 +522,13 @@ void stm32_main(uint32_t reset_mode) {
522522
523523soft_reset :
524524
525- #if defined(MICROPY_HW_LED2 )
525+ #if defined(MICROPY_HW_LED2 )
526526 led_state (1 , 0 );
527527 led_state (2 , 1 );
528- #else
528+ #else
529529 led_state (1 , 1 );
530530 led_state (2 , 0 );
531- #endif
531+ #endif
532532 led_state (3 , 0 );
533533 led_state (4 , 0 );
534534
@@ -576,7 +576,7 @@ void stm32_main(uint32_t reset_mode) {
576576 // Define MICROPY_HW_UART_REPL to be PYB_UART_6 and define
577577 // MICROPY_HW_UART_REPL_BAUD in your mpconfigboard.h file if you want a
578578 // REPL on a hardware UART as well as on USB VCP
579- #if defined(MICROPY_HW_UART_REPL )
579+ #if defined(MICROPY_HW_UART_REPL )
580580 {
581581 mp_obj_t args [2 ] = {
582582 MP_OBJ_NEW_SMALL_INT (MICROPY_HW_UART_REPL ),
@@ -585,13 +585,13 @@ void stm32_main(uint32_t reset_mode) {
585585 MP_STATE_PORT (pyb_stdio_uart ) = pyb_uart_type .make_new ((mp_obj_t )& pyb_uart_type , MP_ARRAY_SIZE (args ), 0 , args );
586586 uart_attach_to_repl (MP_STATE_PORT (pyb_stdio_uart ), true);
587587 }
588- #else
588+ #else
589589 MP_STATE_PORT (pyb_stdio_uart ) = NULL ;
590- #endif
590+ #endif
591591
592- #if MICROPY_HW_ENABLE_CAN
592+ #if MICROPY_HW_ENABLE_CAN
593593 can_init0 ();
594- #endif
594+ #endif
595595
596596 #if MICROPY_HW_ENABLE_USB
597597 pyb_usb_init0 ();
@@ -602,15 +602,15 @@ void stm32_main(uint32_t reset_mode) {
602602 bool mounted_flash = init_flash_fs (reset_mode );
603603
604604 bool mounted_sdcard = false;
605- #if MICROPY_HW_HAS_SDCARD
605+ #if MICROPY_HW_HAS_SDCARD
606606 // if an SD card is present then mount it on /sd/
607607 if (sdcard_is_present ()) {
608608 // if there is a file in the flash called "SKIPSD", then we don't mount the SD card
609609 if (!mounted_flash || f_stat (& fs_user_mount_flash .fatfs , "/SKIPSD" , NULL ) != FR_OK ) {
610610 mounted_sdcard = init_sdcard_fs ();
611611 }
612612 }
613- #endif
613+ #endif
614614
615615 #if MICROPY_HW_ENABLE_USB
616616 // if the SD card isn't used as the USB MSC medium then use the internal flash
@@ -649,12 +649,12 @@ void stm32_main(uint32_t reset_mode) {
649649 }
650650
651651 // turn boot-up LEDs off
652- #if !defined(MICROPY_HW_LED2 )
652+ #if !defined(MICROPY_HW_LED2 )
653653 // If there is only one LED on the board then it's used to signal boot-up
654654 // and so we turn it off here. Otherwise LED(1) is used to indicate dirty
655655 // flash cache and so we shouldn't change its state.
656656 led_state (1 , 0 );
657- #endif
657+ #endif
658658 led_state (2 , 0 );
659659 led_state (3 , 0 );
660660 led_state (4 , 0 );
@@ -670,24 +670,22 @@ void stm32_main(uint32_t reset_mode) {
670670 }
671671 #endif
672672
673- #if MICROPY_HW_HAS_MMA7660
673+ #if MICROPY_HW_HAS_MMA7660
674674 // MMA accel: init and reset
675675 accel_init ();
676- #endif
676+ #endif
677677
678- #if MICROPY_HW_ENABLE_SERVO
679- // servo
678+ #if MICROPY_HW_ENABLE_SERVO
680679 servo_init ();
681- #endif
680+ #endif
682681
683- #if MICROPY_HW_ENABLE_DAC
684- // DAC
682+ #if MICROPY_HW_ENABLE_DAC
685683 dac_init ();
686- #endif
684+ #endif
687685
688- #if MICROPY_PY_NETWORK
686+ #if MICROPY_PY_NETWORK
689687 mod_network_init ();
690- #endif
688+ #endif
691689
692690 // At this point everything is fully configured and initialised.
693691
@@ -738,9 +736,9 @@ void stm32_main(uint32_t reset_mode) {
738736 #endif
739737 timer_deinit ();
740738 uart_deinit ();
741- #if MICROPY_HW_ENABLE_CAN
739+ #if MICROPY_HW_ENABLE_CAN
742740 can_deinit ();
743- #endif
741+ #endif
744742 machine_deinit ();
745743
746744 #if MICROPY_PY_THREAD
0 commit comments