use parameterized enableWdt

This commit is contained in:
Nicu Hodos 2017-01-29 20:33:41 +01:00
parent c951dffaec
commit 023859489c
4 changed files with 3 additions and 11 deletions

View File

@ -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);

View File

@ -22,7 +22,7 @@ void setup() {
sensor.sendWindowState(readState());
TinyPower::setup();
TinyPower::enableWdt();
TinyPower::enableWdt(WDTO_8S);
}
void loop() {

View File

@ -24,7 +24,7 @@ void setup() {
sensor.sendWindowState(readState());
TinyPower::setup();
TinyPower::enableWdt();
TinyPower::enableWdt(WDTO_8S);
}
void loop() {

View File

@ -21,7 +21,7 @@ void setup() {
sensor.sendWindowState(readState());
TinyPower::setup();
TinyPower::enableWdt();
TinyPower::enableWdt(WDTO_8S);
}
void loop() {