diff options
author | Keith Packard <keithp@keithp.com> | 2012-11-30 16:01:07 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-11-30 16:01:07 -0800 |
commit | 0b65402361f36a0c722977bcb63edb26fda0db28 (patch) | |
tree | 435d23c147829f11aac67fd6c30c74dd96f76e8e /src/avr | |
parent | 0fa9ce23dd63846337872d6d666a469512614d07 (diff) |
altos: Make stdio 8-bit clean by making pollchar return int
We were stealing one value (0xff) in the return value from pollchar to
indicate 'not ready yet'. Instead of doing that, use the integer value
-1 and have pollchar return an int instead of a char. That
necessitated cleaning a few other bits to make sure that 0xff wouldn't
get promoted to -1 on accident.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/avr')
-rw-r--r-- | src/avr/ao_usb_avr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/avr/ao_usb_avr.c b/src/avr/ao_usb_avr.c index 9ba407af..2ef546c9 100644 --- a/src/avr/ao_usb_avr.c +++ b/src/avr/ao_usb_avr.c @@ -480,10 +480,10 @@ ao_usb_putchar(char c) __critical __reentrant ao_usb_in_flushed = 0; } -static char +static int _ao_usb_pollchar(void) { - char c; + uint8_t c; uint8_t intx; if (!ao_usb_running) @@ -517,10 +517,10 @@ _ao_usb_pollchar(void) return c; } -char +int ao_usb_pollchar(void) { - char c; + int c; cli(); c = _ao_usb_pollchar(); sei(); @@ -530,7 +530,7 @@ ao_usb_pollchar(void) char ao_usb_getchar(void) __critical { - char c; + int c; cli(); while ((c = _ao_usb_pollchar()) == AO_READ_AGAIN) |