Skip to content

Commit a069340

Browse files
rolandvsglennrub
authored andcommitted
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.
1 parent 226399b commit a069340

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ports/nrf/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ extern uint32_t _heap_end;
9595

9696
int main(int argc, char **argv) {
9797

98+
9899
soft_reset:
100+
101+
led_init();
102+
103+
led_state(1, 1); // MICROPY_HW_LED_1 aka MICROPY_HW_LED_RED
104+
99105
mp_stack_set_top(&_ram_end);
100106

101107
// Stack limit should be less than real stack size, so we have a chance
@@ -192,14 +198,6 @@ pin_init0();
192198
}
193199
#endif
194200

195-
#if (MICROPY_HW_HAS_LED)
196-
led_init();
197-
198-
do_str("import board\r\n" \
199-
"board.LED(1).on()",
200-
MP_PARSE_FILE_INPUT);
201-
#endif
202-
203201
// Main script is finished, so now go into REPL mode.
204202
// The REPL mode can change, or it can request a soft reset.
205203
int ret_code = 0;
@@ -225,6 +223,8 @@ pin_init0();
225223
pwm_start();
226224
#endif
227225

226+
led_state(1, 0);
227+
228228
#if MICROPY_VFS || MICROPY_MBFS
229229
// run boot.py and main.py if they exist.
230230
pyexec_file_if_exists("boot.py");

0 commit comments

Comments
 (0)