From e3c80bf08fee6d0672f8d9a3aabff59fcf5ebd49 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 10 May 2019 05:58:36 +1000 Subject: [PATCH] HAL_ChibiOS: fixed bootloader build --- libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp index 88c8864a2f..0b60c8ba57 100644 --- a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp +++ b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp @@ -29,7 +29,9 @@ #include "hwdef/common/watchdog.h" #include #include +#ifndef HAL_BOOTLOADER_BUILD #include +#endif #include @@ -201,7 +203,9 @@ static void main_loop() g_callbacks->setup(); -#ifndef IOMCU_FW +#ifdef IOMCU_FW + stm32_watchdog_init(); +#elif !defined(HAL_BOOTLOADER_BUILD) // setup watchdog to reset if main loop stops if (AP_BoardConfig::watchdog_enabled()) { stm32_watchdog_init(); @@ -216,9 +220,8 @@ static void main_loop() pd.internal_errors, pd.internal_error_count); } -#else - stm32_watchdog_init(); #endif + schedulerInstance.watchdog_pat(); hal.scheduler->system_initialized();