use parameterized enableWdt
This commit is contained in:
parent
c7080a641d
commit
eeeca94cc8
@ -42,14 +42,6 @@ public:
|
|||||||
WDTCR = _BV(WDIE) | time;
|
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() {
|
static void disableWdt() {
|
||||||
MCUSR = 0x00;
|
MCUSR = 0x00;
|
||||||
WDTCR |= _BV(WDCE) | _BV(WDE);
|
WDTCR |= _BV(WDCE) | _BV(WDE);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ void setup() {
|
|||||||
sensor.sendWindowState(readState());
|
sensor.sendWindowState(readState());
|
||||||
|
|
||||||
TinyPower::setup();
|
TinyPower::setup();
|
||||||
TinyPower::enableWdt();
|
TinyPower::enableWdt(WDTO_8S);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ void setup() {
|
|||||||
sensor.sendWindowState(readState());
|
sensor.sendWindowState(readState());
|
||||||
|
|
||||||
TinyPower::setup();
|
TinyPower::setup();
|
||||||
TinyPower::enableWdt();
|
TinyPower::enableWdt(WDTO_8S);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ void setup() {
|
|||||||
sensor.sendWindowState(readState());
|
sensor.sendWindowState(readState());
|
||||||
|
|
||||||
TinyPower::setup();
|
TinyPower::setup();
|
||||||
TinyPower::enableWdt();
|
TinyPower::enableWdt(WDTO_8S);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user