changeset 18:bf733e8e8cf0

Add INT0 button
author Matt Johnston <matt@ucc.asn.au>
date Tue, 22 May 2012 21:27:50 +0800
parents 54b0fda9cba7
children f1016b151689
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;