Watchdog cleanup (#15283)
This commit is contained in:
@@ -26,6 +26,10 @@
|
||||
#include "../shared/Delay.h"
|
||||
#include "../../../gcode/parser.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
// U8glib required functions
|
||||
extern "C" void u8g_xMicroDelay(uint16_t val) {
|
||||
DELAY_US(val);
|
||||
@@ -65,4 +69,17 @@ void flashFirmware(int16_t value) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
watchdog_clear_timeout_flag();
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
if (watchdog_timed_out()) return RST_WATCHDOG;
|
||||
#endif
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
|
||||
#endif // TARGET_LPC1768
|
||||
|
||||
Reference in New Issue
Block a user