From 558d74d352e19a79dc1839c47255022cdcf037fe Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Fri, 12 Nov 2010 10:36:59 +0100 Subject: [PATCH] avr: include analog comparator and pulse input code into basiciotest --- mote/v2/avr/basiciotest.c | 73 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/mote/v2/avr/basiciotest.c b/mote/v2/avr/basiciotest.c index e5cdf3e..d853d69 100644 --- a/mote/v2/avr/basiciotest.c +++ b/mote/v2/avr/basiciotest.c @@ -21,6 +21,9 @@ #include #include +#include + +#include #include "uart.h" #include "spi.h" @@ -40,7 +43,6 @@ #define SPI_FORWARD_TO_UART_PORT 'u' #define SPI_FORWARD_TO_CTRL_PORT 'l' // 'l'ocal port - volatile uint8_t spi_status, high_hex; // hex to binary/byte decoding @@ -167,11 +169,43 @@ ISR(TIMER1_COMPA_vect) /* void */ } -int main(void) +ISR(ANALOG_COMP_vect) +{ + uint8_t i; + + PORTB |= (1< fTOV1 = 3686.4kHz / 65536 = 56.25Hz (DS p.134) TCCR1B |= (1<