Make watchdog code conditional

pull/106/head
erikkaashoek 2 years ago
parent 2be943acd1
commit aa57b9adc3

@ -285,7 +285,9 @@ static THD_FUNCTION(Thread1, arg)
// plot trace and other indications as raster
draw_all(completed); // flush markmap only if scan completed to prevent
// remaining traces
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
// STOP_PROFILE
}
@ -3103,6 +3105,7 @@ int main(void)
set_sweep_frequency(ST_STOP, (freq_t) 4000000);
sweep(false);
#endif
#ifdef __WATCHDOG__
static const WDGConfig scan_wdgcfg = {
STM32_IWDG_PR_256,
STM32_IWDG_RL(1 * (40000 / 256)), /* 1 second */
@ -3110,7 +3113,7 @@ int main(void)
};
wdgInit();
wdgStart(&WDGD1, &scan_wdgcfg);
#endif
if (reset_state|| (caldata_recall(0) == -1)) {
load_LCD_properties();
}

@ -65,6 +65,15 @@
#define __LINEARITY__ // Not available
#define __SELFTEST__ // Add selftest option (not fully disable it)
#define __CALIBRATE__ // Add calibration menu and functions
#define __WATCHDOG__
#ifdef __WATCHDOG__
//#if (HAL_USE_WDG != TRUE)
//#error "HAL_USE_WDG must be set to true"
//#endif
//#if (STM32_WDG_USE_IWDG != TRUE)
//#error "STM32_WDG_USE_IWDG must be set to true"
//#endif
#endif
#define __FAST_SWEEP__ // Pre-fill SI4432 RSSI buffer to get fastest sweep in zero span mode
// #define __AUDIO__
#define __SPUR__ // Does spur reduction by shifting IF

@ -4932,7 +4932,9 @@ again: // Spur redu
t++; // one subscan done
if (break_on_operation && operation_requested) // break subscanning if requested
break; // abort
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
} while (t < local_vbw_steps); // till all sub steps done
TRACE(7);
#ifdef TINYSA4

11
ui.c

@ -186,7 +186,9 @@ int btn_side(void)
static int btn_check(void)
{
systime_t ticks;
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
// Debounce input
while(TRUE){
ticks = chVTGetSystemTimeX();
@ -213,7 +215,9 @@ static int btn_check(void)
static int btn_wait_release(void)
{
while (TRUE) {
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
systime_t ticks = chVTGetSystemTimeX();
systime_t dt = ticks - last_button_down_ticks;
// Debounce input
@ -301,7 +305,9 @@ touch_measure_x(void)
static inline int
touch_status(void)
{
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
return adc_single_read(ADC_TOUCH_Y) > TOUCH_THRESHOLD;
}
@ -657,8 +663,9 @@ extern const char *states[];
break;
chThdSleepMilliseconds(40);
if ((cnt++)&0x07) continue; // Not update time so fast
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
#ifdef TINYSA4
#ifdef __USE_RTC__
@ -7803,7 +7810,9 @@ static void sa_save_file(uint8_t format) {
#else
plot_printf(fs_filename, FF_LFN_BUF, "%08x.%s", rtc_get_FAT(), file_ext[format]);
#endif
#ifdef __WATCHDOG__
wdgReset(&WDGD1);
#endif
}
else {
ui_mode_keypad(KM_FILENAME);

Loading…
Cancel
Save

Powered by TurnKey Linux.