diff main.c @ 330:7ac6b8846eea

- some fixes for server code - don't turn off bluetooth in avr code
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jun 2012 22:32:49 +0800
parents 46070aaf29ea
children 2943f62c8e62
line wrap: on
line diff
--- a/main.c	Mon Jun 04 23:50:42 2012 +0800
+++ b/main.c	Wed Jun 06 22:32:49 2012 +0800
@@ -57,6 +57,7 @@
 
 int uart_putchar(char c, FILE *stream);
 static void long_delay(int ms);
+static void blink();
 
 static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,
         _FDEV_SETUP_WRITE);
@@ -138,7 +139,7 @@
     }
     else
     {
-        PORT_SHDN |= _BV(PIN_SHDN);
+        //PORT_SHDN |= _BV(PIN_SHDN);
     }
 }
 
@@ -181,11 +182,13 @@
 static void 
 uart_off()
 {
+#if 0
     // Turn of interrupts and disable tx/rx
     UCSR0B = 0;
 
     // Power reduction register
     //PRR |= _BV(PRUSART0);
+#endif
 }
 
 int 
@@ -463,6 +466,20 @@
 ISR(INT0_vect)
 {
 	need_comms = 1;
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
+    blink();
+    _delay_ms(100);
 }
 
 
@@ -652,6 +669,7 @@
 do_comms()
 {
 	// turn on bluetooth
+    set_aux_power(1);
     uart_on();
 	
 	// write sd card here? same 3.3v regulator...