Commit 3790f5f0 authored by Piotr Dymacz's avatar Piotr Dymacz Committed by Jamie
Browse files

boot: zephyr: use indication LED also in timeout based recovery

This adds support for indication LED option (MCUBOOT_INDICATION_LED) in
the timeout based recovery. Configured LED will be enabled when entering
the recovery and disabled after selected timeout (if no mcumgr command
was received).

Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
parent 0035c33b
Loading
Loading
Loading
Loading
+8 −0
Changes for boot/zephyr/main.c: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -622,6 +622,10 @@ int main(void)
    rc = boot_console_init();
    int timeout_in_ms = CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT;
    uint32_t start = k_uptime_get_32();

#ifdef CONFIG_MCUBOOT_INDICATION_LED
    gpio_pin_set_dt(&led0, 1);
#endif
#endif

    FIH_CALL(boot_go, fih_rc, &rsp);
@@ -645,6 +649,10 @@ int main(void)
        timeout_in_ms = 1;
    }
    boot_serial_check_start(&boot_funcs,timeout_in_ms);

#ifdef CONFIG_MCUBOOT_INDICATION_LED
    gpio_pin_set_dt(&led0, 0);
#endif
#endif

    if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {