X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Fserial.h;h=696c20e8f37c28d0cf1617873f5c6ca972ecb97b;hb=9def58c4bbec8788430740a1e9afce64a496231f;hp=e62b0a9df7137ce313ba15420de7a8308e1d8821;hpb=ed7a7139f4858fe5d0c756798538d25893bf58b2;p=r2c2.git diff --git a/firmware/serial.h b/firmware/serial.h index e62b0a9..696c20e 100644 --- a/firmware/serial.h +++ b/firmware/serial.h @@ -1,10 +1,23 @@ +/* $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 + +#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