change order of command to avoid off-on
This commit is contained in:
parent
4e72a3da3e
commit
4851f7355b
@ -2,17 +2,12 @@
|
||||
#include <avr/power.h>
|
||||
#include <avr/wdt.h>
|
||||
|
||||
#include <RCSwitch.h>
|
||||
#include <SoftwareSerial_Tiny.h>
|
||||
|
||||
#define DEBUG 0
|
||||
#define RC_SWITCH 1
|
||||
|
||||
#if RC_SWITCH
|
||||
#include <RCSwitch.h>
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#include <SoftwareSerial_Tiny.h>
|
||||
#endif
|
||||
|
||||
// Utility macros
|
||||
#define adc_disable() (ADCSRA &= ~_BV(ADEN)) // disable ADC (before power-off)
|
||||
#define adc_enable() (ADCSRA |= _BV(ADEN)) // re-enable ADC
|
||||
@ -23,7 +18,7 @@
|
||||
|
||||
#if DEBUG
|
||||
#define RxD 0
|
||||
#define TxD 1
|
||||
#define TxD 4
|
||||
SoftwareSerial AttinySerial(RxD,TxD);
|
||||
#endif
|
||||
|
||||
@ -92,9 +87,9 @@ ISR(PCINT0_vect) {
|
||||
}
|
||||
|
||||
ISR(WDT_vect) {
|
||||
timerTriggered = true;
|
||||
debug("wdt");
|
||||
sendCommand(false);
|
||||
timerTriggered = true;
|
||||
disableWdt();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user