mirror of
https://github.com/opentx/opentx.git
synced 2025-07-18 22:05:10 +03:00
Re #3340: Watchdog still disabled on Horus, but use -DWATCHDOG_DISABLED=OFF to enable it. Radio currently resets if WDT is enabled, because external module functions are not yet implemented. After the radio is stable default for WATCHDOG_DISABLED will be set to OFF
This commit is contained in:
parent
1147db45a4
commit
4ebca98cdf
3 changed files with 19 additions and 3 deletions
|
@ -18,6 +18,7 @@ option(AUTOSOURCE "Automatic source detection in menus" ON)
|
||||||
option(AUTOSWITCH "Automatic switch detection in menus" ON)
|
option(AUTOSWITCH "Automatic switch detection in menus" ON)
|
||||||
option(JITTER_MEASURE "Enable ADC jitter measurement" OFF)
|
option(JITTER_MEASURE "Enable ADC jitter measurement" OFF)
|
||||||
option(JITTER_FILTER "Enable ADC jitter filtering" ON)
|
option(JITTER_FILTER "Enable ADC jitter filtering" ON)
|
||||||
|
option(WATCHDOG_DISABLED "Disable hardware Watchdog on Horus" ON)
|
||||||
|
|
||||||
enable_language(ASM)
|
enable_language(ASM)
|
||||||
set(OPT s)
|
set(OPT s)
|
||||||
|
@ -784,6 +785,10 @@ if(JITTER_FILTER)
|
||||||
add_definitions(-DJITTER_FILTER)
|
add_definitions(-DJITTER_FILTER)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WATCHDOG_DISABLED)
|
||||||
|
add_definitions(-DWATCHDOG_DISABLED)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SDCARD)
|
if(SDCARD)
|
||||||
add_definitions(-DSDCARD)
|
add_definitions(-DSDCARD)
|
||||||
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
||||||
|
|
|
@ -272,7 +272,13 @@ int cliMemoryInfo(const char ** argv)
|
||||||
int cliReboot(const char ** argv)
|
int cliReboot(const char ** argv)
|
||||||
{
|
{
|
||||||
#if !defined(SIMU)
|
#if !defined(SIMU)
|
||||||
NVIC_SystemReset();
|
if (!strcmp(argv[1], "wdt")) {
|
||||||
|
// do a user requested watchdog test by pausing mixer thread
|
||||||
|
pausePulses();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
NVIC_SystemReset();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,8 +202,13 @@ void checkRotaryEncoder(void);
|
||||||
#if !defined(SIMU)
|
#if !defined(SIMU)
|
||||||
#define wdt_disable()
|
#define wdt_disable()
|
||||||
void watchdogInit(unsigned int duration);
|
void watchdogInit(unsigned int duration);
|
||||||
#define wdt_enable(x) // watchdogInit(1500)
|
#if defined(WATCHDOG_DISABLED)
|
||||||
#define wdt_reset() // IWDG->KR = 0xAAAA
|
#define wdt_enable(x)
|
||||||
|
#define wdt_reset()
|
||||||
|
#else
|
||||||
|
#define wdt_enable(x) watchdogInit(1500)
|
||||||
|
#define wdt_reset() IWDG->KR = 0xAAAA
|
||||||
|
#endif
|
||||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue