diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 39b1b5876..4cc05489d 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -32,7 +32,7 @@ option(AUTOSOURCE "Automatic source detection in menus" ON) option(AUTOSWITCH "Automatic switch detection in menus" ON) option(SEMIHOSTING "Enable debugger semihosting" OFF) option(JITTER_MEASURE "Enable ADC jitter measurement" OFF) -option(WATCHDOG_DISABLED "Disable hardware Watchdog" OFF) +option(WATCHDOG "Enable hardware Watchdog" ON) if(SDL_FOUND) option(SIMU_AUDIO "Enable simulator audio." ON) endif() @@ -233,8 +233,8 @@ if(JITTER_MEASURE) add_definitions(-DJITTER_MEASURE) endif() -if(WATCHDOG_DISABLED) - add_definitions(-DWATCHDOG_DISABLED) +if(WATCHDOG) + add_definitions(-DWATCHDOG) endif() if(SIMU_AUDIO) diff --git a/radio/src/gui/480x272/themes/default.cpp b/radio/src/gui/480x272/themes/default.cpp index 0183a601c..d444a6994 100644 --- a/radio/src/gui/480x272/themes/default.cpp +++ b/radio/src/gui/480x272/themes/default.cpp @@ -91,7 +91,7 @@ class DefaultTheme: public Theme void loadIcons() const { -#if defined(LOG_TELEMETRY) || defined(WATCHDOG_DISABLED) +#if defined(LOG_TELEMETRY) || !defined(WATCHDOG) loadMenuIcon(ICON_OPENTX, "mask_opentx_testmode.png", TEXT_COLOR); #else loadMenuIcon(ICON_OPENTX, "mask_opentx.png"); diff --git a/radio/src/opentx.h b/radio/src/opentx.h index f276b8283..b005f1b39 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1389,7 +1389,7 @@ extern uint8_t latencyToggleSwitch; inline bool isAsteriskDisplayed() { -#if defined(LOG_TELEMETRY) || defined(WATCHDOG_DISABLED) || defined(DEBUG_LATENCY) +#if defined(LOG_TELEMETRY) || !defined(WATCHDOG) || defined(DEBUG_LATENCY) return true; #endif diff --git a/radio/src/targets/horus/board.h b/radio/src/targets/horus/board.h index b66d47452..0cb3ed908 100644 --- a/radio/src/targets/horus/board.h +++ b/radio/src/targets/horus/board.h @@ -317,12 +317,12 @@ void watchdogInit(unsigned int duration); #define wdt_enable(x) #define wdt_reset() #else - #if defined(WATCHDOG_DISABLED) - #define wdt_enable(x) - #define wdt_reset() - #else + #if defined(WATCHDOG) #define wdt_enable(x) watchdogInit(x) #define wdt_reset() IWDG->KR = 0xAAAA + #else + #define wdt_enable(x) + #define wdt_reset() #endif #define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF)) #define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF) diff --git a/radio/src/targets/sky9x/board.h b/radio/src/targets/sky9x/board.h index 7ba1f781b..c6625e760 100644 --- a/radio/src/targets/sky9x/board.h +++ b/radio/src/targets/sky9x/board.h @@ -258,7 +258,7 @@ extern "C" { #endif // WDT driver -#if defined(WATCHDOG_DISABLED) || defined(SIMU) +#if !defined(WATCHDOG) || defined(SIMU) #define wdt_enable(x) #define wdt_reset() #define IS_RESET_REASON_WATCHDOG() false diff --git a/radio/src/targets/taranis/board.h b/radio/src/targets/taranis/board.h index 25a021a8d..b7cfff1e4 100644 --- a/radio/src/targets/taranis/board.h +++ b/radio/src/targets/taranis/board.h @@ -431,7 +431,7 @@ uint32_t readTrims(); // WDT driver #define WDTO_500MS 500 -#if defined(WATCHDOG_DISABLED) || defined(SIMU) +#if !defined(WATCHDOG) || defined(SIMU) #define wdt_enable(x) #define wdt_reset() #else