X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Fserial.h;h=04ea50b198fc502c2d4812ddd370746bc2e6ae93;hb=49b6b6ad84ec47b4f9eb9ef131975cc5b72372a2;hp=e62b0a9df7137ce313ba15420de7a8308e1d8821;hpb=d8a31ed675778c08ca781beb62863c62d6f0bd94;p=model-railway-devices.git diff --git a/firmware/serial.h b/firmware/serial.h index e62b0a9..04ea50b 100644 --- a/firmware/serial.h +++ b/firmware/serial.h @@ -1,10 +1,16 @@ #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