Avoids the double negation WATCHDOG_DISABLED=NO
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user