+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2010 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#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