X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Fserial.h;h=04ea50b198fc502c2d4812ddd370746bc2e6ae93;hb=8b7d4054b05002d82338775ac9b4ee764a8560e4;hp=e62b0a9df7137ce313ba15420de7a8308e1d8821;hpb=ed7a7139f4858fe5d0c756798538d25893bf58b2;p=r2c2.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