Add Disable and use the avrlibc wdt functions
parent
56eee8dcfb
commit
a433db5648
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue