nrf/main: Update the way the LED is used on startup.
In case of LED1 being present, do a short blink during startup
instead of turning it on and leave it on.
@@ -95,7 +95,13 @@ extern uint32_t _heap_end;
int main(int argc, char **argv) {
+
soft_reset:
+
+ led_init();
+
+ led_state(1, 1); // MICROPY_HW_LED_1 aka MICROPY_HW_LED_RED
+
mp_stack_set_top(&_ram_end);
// Stack limit should be less than real stack size, so we have a chance
@@ -192,14 +198,6 @@ pin_init0();
}
#endif
-#if (MICROPY_HW_HAS_LED)
- led_init();
-
- do_str("import board\r\n" \
- "board.LED(1).on()",
- MP_PARSE_FILE_INPUT);
-#endif
-
// Main script is finished, so now go into REPL mode.
// The REPL mode can change, or it can request a soft reset.
int ret_code = 0;
@@ -225,6 +223,8 @@ pin_init0();
pwm_start();
#endif
+led_state(1, 0);
+
#if MICROPY_VFS || MICROPY_MBFS
// run boot.py and main.py if they exist.
pyexec_file_if_exists("boot.py");
