Add Disable and use the avrlibc wdt functions

pull/67/head^2
Alex Voinea 2021-07-20 13:57:27 +03:00
parent 56eee8dcfb
commit a433db5648
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#include "../watchdog.h" #include "../watchdog.h"
#include <avr/wdt.h>
namespace hal { namespace hal {
namespace watchdog { namespace watchdog {
@ -7,8 +8,12 @@ void Enable(uint16_t period) {
// @@TODO // @@TODO
} }
void Disable() {
wdt_disable();
}
void Reset() { void Reset() {
asm("wdr"); wdt_reset();
} }
} // namespace watchdog } // namespace watchdog

View File

@ -8,6 +8,7 @@ namespace watchdog {
/// watchdog interface /// watchdog interface
void Enable(uint16_t period); void Enable(uint16_t period);
void Disable();
void Reset(); void Reset();
} // namespace watchdog } // namespace watchdog