Mercurial > templog
changeset 324:e3664732f11f
Add INT0 button
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 22 May 2012 21:27:50 +0800 |
parents | df7384336798 |
children | b05c9fd7c098 |
files | main.c |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
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;