From 5fdf476c101b0a3a414519798eb72fcc13825167 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 1 Nov 2013 00:08:33 +0200 Subject: [PATCH] Use the new serial API in s88w-r --- s88w/s88w-r.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/s88w/s88w-r.c b/s88w/s88w-r.c index 0198974..15365b4 100644 --- a/s88w/s88w-r.c +++ b/s88w/s88w-r.c @@ -33,7 +33,7 @@ D5 - S88 RESET #define BIT(n) (1<<(n)) -void receive(uint8_t); +void check_input(); uint8_t hexdigit(uint8_t); uint8_t decode_hex(uint8_t); @@ -67,6 +67,8 @@ int main() { uint8_t b_pins, d_pins; + check_input(); + b_pins = PINB; d_pins = PIND; @@ -133,8 +135,13 @@ int main() } } -void receive(uint8_t c) +void check_input() { + uint8_t c; + if(!serial_read_available()) + return; + + c = serial_read(); if(rx_fill==0xFF) { if(c==':') @@ -197,8 +204,6 @@ void receive(uint8_t c) } } -SERIAL_SET_CALLBACK(receive) - uint8_t hexdigit(uint8_t n) { n &= 0xF; -- 2.43.0