summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroland van straten <roland@van-straten.org>2019-09-27 09:58:21 +0200
committerGlenn Ruben Bakke <glennbakke@gmail.com>2019-10-02 22:17:54 +0200
commita069340c1ee14fe5e956e38aa4482f526145d7d3 (patch)
tree1201ff462d12312016d32973e9e36a4bc43dba85
parent226399bcef8abf2f831cdb139c9bd0d416850ab5 (diff)
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.
-rw-r--r--ports/nrf/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ports/nrf/main.c b/ports/nrf/main.c
index 38d41bd8c..e82cfcf58 100644
--- a/ports/nrf/main.c
+++ b/ports/nrf/main.c
@@ -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");