Avoids the double negation WATCHDOG_DISABLED=NO

This commit is contained in:
Bertrand Songis
2019-09-07 13:40:53 +02:00
parent d681ba424a
commit 36395c2f8e
6 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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");
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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