# HG changeset patch # User Matt Johnston # Date 1337344720 -28800 # Node ID 7aebb1452422f02bdb0427e6f4762c5e379ae777 # Parent 139ecb1840fd500fcbe9a3c9ae00ab3d143dfc2d deep sleep works diff -r 139ecb1840fd -r 7aebb1452422 main.c --- a/main.c Fri May 18 19:15:40 2012 +0800 +++ b/main.c Fri May 18 20:38:40 2012 +0800 @@ -56,11 +56,16 @@ static uint8_t measure_count = 0; static uint16_t comms_count = 0; +#define DEBUG(str) printf_P(PSTR(str)) + static void deep_sleep(); static void uart_on() { + // Power reduction register + //PRR &= ~_BV(PRUSART0); + // baud rate UBRR0H = (unsigned char)(UBRR >> 8); UBRR0L = (unsigned char)UBRR; @@ -69,29 +74,6 @@ UCSR0B = _BV(RXCIE0) | _BV(RXEN0) | _BV(TXEN0); //8N1 UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); - - // Power reduction register - //PRR &= ~_BV(PRUSART0); -} - -static void -uart_test() -{ - - UDR0 = 'n'; - _delay_ms(50); - UDR0 = 'f'; - _delay_ms(50); - while ( !( UCSR0A & (1<