]> git.tdb.fi Git - model-railway-devices.git/blobdiff - firmware/serial.h
Strip Id tags and copyright notices from files
[model-railway-devices.git] / firmware / serial.h
index e62b0a9df7137ce313ba15420de7a8308e1d8821..04ea50b198fc502c2d4812ddd370746bc2e6ae93 100644 (file)
@@ -1,10 +1,16 @@
 #ifndef SERIAL_H_
 #define SERIAL_H_
 
-typedef void SerialCallback(uint8_t);
+#include <avr/interrupt.h>
+
+#define SERIAL_SET_CALLBACK(f) \
+       ISR(USART_RX_vect) \
+       { \
+               char c = UDR0; \
+               f(c); \
+       }
 
 void serial_init(uint16_t);
-void serial_set_callback(SerialCallback *);
 void serial_write(uint8_t);
 
 #endif