Use Correct Prescaler Register
This commit is contained in:
parent
cbcdc0a8a0
commit
67fa6100ee
|
@ -67,7 +67,7 @@ void init_wdt()
|
|||
WDTCSR |= (1<<WDCE) | (1<<WDE);
|
||||
// Set new prescaler (8 sec), unset reset enable
|
||||
// enable WDT interrupt
|
||||
WDTCSR = (1<<WDIE)|(1<<WDP2)|(1<<WDP0);
|
||||
WDTCSR = (1<<WDIE)|(1<<WDP3)|(1<<WDP0);
|
||||
}
|
||||
|
||||
// Enter Sleepmode, Sleep for s Seconds
|
||||
|
@ -89,14 +89,14 @@ ISR(WATCHDOG_vect) {
|
|||
WDTCSR |= (1<<WDCE) | (1<<WDE);
|
||||
// Set new prescaler (8 sec), unset reset enable
|
||||
// enable WDT interrupt
|
||||
WDTCSR = (1<<WDIE)|(1<<WDP2)|(1<<WDP0);
|
||||
WDTCSR = (1<<WDIE)|(1<<WDP3)|(1<<WDP0);
|
||||
}
|
||||
|
||||
// Get Battery Voltage
|
||||
long readVcc() {
|
||||
int32_t readVcc() {
|
||||
bitClear(PRR, PRADC);
|
||||
ADCSRA |= bit(ADEN); // Enable the ADC
|
||||
long result;
|
||||
int32_t result;
|
||||
ADMUX = _BV(MUX5) | _BV(MUX0); // For ATtiny84
|
||||
delay(2); // Wait for Vref to settle
|
||||
ADCSRA |= _BV(ADSC); // Convert
|
||||
|
|
Loading…
Reference in a new issue