AP_Bootloader: use fast boot after watchdog reset

This commit is contained in:
Andrew Tridgell 2019-04-11 21:14:38 +10:00
parent 468ee0bd9b
commit f727f1c62d
1 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,7 @@
#include "hwdef.h"
#include <AP_HAL_ChibiOS/hwdef/common/usbcfg.h>
#include <AP_HAL_ChibiOS/hwdef/common/stm32_util.h>
#include <AP_HAL_ChibiOS/hwdef/common/watchdog.h>
#include "support.h"
#include "bl_protocol.h"
@ -53,7 +54,10 @@ int main(void)
uint32_t timeout = HAL_BOOTLOADER_TIMEOUT;
enum rtc_boot_magic m = check_fast_reboot();
if (m == RTC_BOOT_HOLD) {
if (stm32_was_watchdog_reset()) {
try_boot = true;
timeout = 0;
} else if (m == RTC_BOOT_HOLD) {
timeout = 0;
} else if (m == RTC_BOOT_FAST) {
try_boot = true;