use parameterized enableWdt
This commit is contained in:
parent
c951dffaec
commit
023859489c
@ -42,14 +42,6 @@ public:
|
||||
WDTCR = _BV(WDIE) | time;
|
||||
}
|
||||
|
||||
//enable the wdt for 8sec interrupt
|
||||
static void enableWdt()
|
||||
{
|
||||
MCUSR = 0x00;
|
||||
WDTCR |= _BV(WDCE) | _BV(WDE);
|
||||
WDTCR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0); //8192ms
|
||||
}
|
||||
|
||||
static void disableWdt() {
|
||||
MCUSR = 0x00;
|
||||
WDTCR |= _BV(WDCE) | _BV(WDE);
|
||||
|
||||
@ -22,7 +22,7 @@ void setup() {
|
||||
sensor.sendWindowState(readState());
|
||||
|
||||
TinyPower::setup();
|
||||
TinyPower::enableWdt();
|
||||
TinyPower::enableWdt(WDTO_8S);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@ -24,7 +24,7 @@ void setup() {
|
||||
sensor.sendWindowState(readState());
|
||||
|
||||
TinyPower::setup();
|
||||
TinyPower::enableWdt();
|
||||
TinyPower::enableWdt(WDTO_8S);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@ -21,7 +21,7 @@ void setup() {
|
||||
sensor.sendWindowState(readState());
|
||||
|
||||
TinyPower::setup();
|
||||
TinyPower::enableWdt();
|
||||
TinyPower::enableWdt(WDTO_8S);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user