Mercurial > templog
diff main.c @ 324:e3664732f11f
Add INT0 button
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 22 May 2012 21:27:50 +0800 |
parents | df7384336798 |
children | f1016b151689 |
line wrap: on
line diff
--- a/main.c Sun May 20 22:16:56 2012 +0800 +++ b/main.c Tue May 22 21:27:50 2012 +0800 @@ -92,6 +92,16 @@ static void deep_sleep(); +static void +chip_setup() +{ + // INT0 setup + EIMSK = _BV(INT0); + // set pullup + PORTD |= _BV(PD2); +} + + static void uart_on() { @@ -394,6 +404,12 @@ } } +ISR(INT0_vwct) +{ + need_comms = 1; +} + + ISR(USART_RX_vect) { char c = UDR0;