it works!
[slipway.git] / src / edu / berkeley / obits / device / atmel / AvrDrone.c
index 0878b4f..b50eaab 100644 (file)
@@ -3,11 +3,14 @@
 //\r
 \r
 #define F_CPU 3960000\r
-#define __AVR_AT94K__\r
+\r
+#if !defined(__AVR_AT94K__)\r
+#error you forgot to put -mmcu=at94k on the command line\r
+#endif\r
+\r
 #include <avr/wdt.h>\r
-#include <avr/delay.h>\r
+#include <util/delay.h>\r
 #include <avr/io.h>\r
-#include <avr/signal.h>\r
 #include <avr/interrupt.h>\r
 \r
 unsigned char val = 0;\r
@@ -106,12 +109,12 @@ void doreset() {
   while(1) { }\r
 }\r
 \r
-SIGNAL(SIG_INTERRUPT1) {\r
+ISR(SIG_INTERRUPT1) {   // use interrupt1 since interrupt0 is sent by the watchdog (I think)\r
   doreset();\r
 }\r
 \r
 void die() { cli(); cts(0); _delay_ms(2000); while(1) { } }\r
-SIGNAL(SIG_UART1_RECV) {\r
+ISR(SIG_UART1_RECV) {\r
   if (UCSR1A & (1 << FE1))   { portd(2,0); portd(3,1); die(); }  // framing error, lock up with LED=01\r
   if ((UCSR1A & (1 << OR1))) { portd(2,1); portd(3,0); die(); }  // overflow; lock up with LED=10\r
   if (full())                { portd(2,1); portd(3,1); die(); }  // buffer overrun\r