X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Fserial.h;fp=firmware%2Fserial.h;h=696c20e8f37c28d0cf1617873f5c6ca972ecb97b;hb=238cd5e5bd9c6fa86ae85f5eb7a8ce00158f2f7c;hp=e62b0a9df7137ce313ba15420de7a8308e1d8821;hpb=d8a31ed675778c08ca781beb62863c62d6f0bd94;p=model-railway-devices.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