mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
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.
This commit is contained in:
parent
226399bcef
commit
a069340c1e
@ -95,7 +95,13 @@ extern uint32_t _heap_end;
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
soft_reset:
|
soft_reset:
|
||||||
|
|
||||||
|
led_init();
|
||||||
|
|
||||||
|
led_state(1, 1); // MICROPY_HW_LED_1 aka MICROPY_HW_LED_RED
|
||||||
|
|
||||||
mp_stack_set_top(&_ram_end);
|
mp_stack_set_top(&_ram_end);
|
||||||
|
|
||||||
// Stack limit should be less than real stack size, so we have a chance
|
// Stack limit should be less than real stack size, so we have a chance
|
||||||
@ -192,14 +198,6 @@ pin_init0();
|
|||||||
}
|
}
|
||||||
#endif
|
#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.
|
// Main script is finished, so now go into REPL mode.
|
||||||
// The REPL mode can change, or it can request a soft reset.
|
// The REPL mode can change, or it can request a soft reset.
|
||||||
int ret_code = 0;
|
int ret_code = 0;
|
||||||
@ -225,6 +223,8 @@ pin_init0();
|
|||||||
pwm_start();
|
pwm_start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
led_state(1, 0);
|
||||||
|
|
||||||
#if MICROPY_VFS || MICROPY_MBFS
|
#if MICROPY_VFS || MICROPY_MBFS
|
||||||
// run boot.py and main.py if they exist.
|
// run boot.py and main.py if they exist.
|
||||||
pyexec_file_if_exists("boot.py");
|
pyexec_file_if_exists("boot.py");
|
||||||
|
Loading…
Reference in New Issue
Block a user