diff --git a/uc/Makefile b/uc/Makefile index de9eff1..1750239 100755 --- a/uc/Makefile +++ b/uc/Makefile @@ -174,17 +174,8 @@ all: bin_files build sizeafter build: elf hex eep bin_files: $(TARGET).c - # Here is the "preprocessing". - # It creates a .cpp file based with the same name as the .pde file. - # On top of the new .cpp file comes the WProgram.h header. - # At the end there is a generic main() function attached. - # Then the .cpp file will be compiled. Errors during compile will - # refer to this new, automatically generated, file. - # Not the original .pde file you actually edit... test -d bin || mkdir bin - #echo '#include "WProgram.h"' > bin/$(TARGET).cpp cp $(TARGET).c bin/$(TARGET).c - #cat main.cxx >> bin/$(TARGET).cpp elf: bin/$(TARGET).elf hex: bin/$(TARGET).hex diff --git a/uc/main.c b/uc/main.c index 9da299f..ff0052b 100644 --- a/uc/main.c +++ b/uc/main.c @@ -44,30 +44,18 @@ volatile struct sensor measurements[4]; // interrupt service routine for INT0 ISR(INT0_vect) { - measurements[0].value++; - aux[0].pulse = true; -} - -// interrupt service routine for INT1 -ISR(INT1_vect) { measurements[1].value++; aux[1].pulse = true; } -// interrupt service routine for PCI2 (PCINT20 = pin4) -ISR(PCINT2_vect) { - if (aux[2].toggle == false) { - aux[2].toggle = true; - } - else { - measurements[2].value++; - aux[2].pulse = true; - aux[2].toggle = false; - } +// interrupt service routine for INT1 +ISR(INT1_vect) { + measurements[2].value++; + aux[2].pulse = true; } -// interrupt service routine for PCI0 (PCINT1 = pin9) -ISR(PCINT0_vect) { +// interrupt service routine for PCI2 (PCINT20) +ISR(PCINT2_vect) { if (aux[3].toggle == false) { aux[3].toggle = true; } @@ -78,6 +66,7 @@ ISR(PCINT0_vect) { } } +// interrupt service routine for ADC ISR(TIMER2_OVF_vect) { // read ADC result // add to nano(Wh) counter @@ -188,14 +177,6 @@ void setup() //pin change interrupt enable 2 PCICR |= (1<