From: Keith Packard Date: Fri, 7 Dec 2012 18:05:51 +0000 (-0800) Subject: altos: fix functions calling pollchar to use 'int' to hold the value X-Git-Tag: 1.1.9.3~22 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c10f9a438ed5789479d21c78153ca7f14c05534c;hp=16fd9009d8b034fd8d208115317f65fabe10072a altos: fix functions calling pollchar to use 'int' to hold the value AO_READ_AGAIN doesn't fit in a char anymore now that stdio is 8-bit clean, everyone using pollchar must use an 'int' variable to capture the whole value from pollchar. Signed-off-by: Keith Packard --- diff --git a/src/cc1111/ao_usb.c b/src/cc1111/ao_usb.c index 81e9074e..f66e807c 100644 --- a/src/cc1111/ao_usb.c +++ b/src/cc1111/ao_usb.c @@ -411,7 +411,7 @@ ao_usb_getchar(void) __critical { int c; - while ((c = ao_usb_pollchar()) == -1) + while ((c = ao_usb_pollchar()) == AO_READ_AGAIN) ao_sleep(&ao_stdin_ready); return c; } diff --git a/src/core/ao_stdio.c b/src/core/ao_stdio.c index 4a832487..1748dfe8 100644 --- a/src/core/ao_stdio.c +++ b/src/core/ao_stdio.c @@ -98,7 +98,7 @@ __xdata uint8_t ao_stdin_ready; char getchar(void) __reentrant { - char c; + int c; ao_arch_critical( int8_t stdio = ao_cur_stdio; diff --git a/src/drivers/ao_btm.c b/src/drivers/ao_btm.c index f3816047..c862200a 100644 --- a/src/drivers/ao_btm.c +++ b/src/drivers/ao_btm.c @@ -120,7 +120,7 @@ uint8_t ao_btm_get_line(void) { uint8_t ao_btm_reply_len = 0; - char c; + int c; for (;;) { diff --git a/src/drivers/ao_packet_master.c b/src/drivers/ao_packet_master.c index 481232df..023c788b 100644 --- a/src/drivers/ao_packet_master.c +++ b/src/drivers/ao_packet_master.c @@ -20,7 +20,7 @@ static char ao_packet_getchar(void) { - char c; + int c; while ((c = ao_packet_pollchar()) == AO_READ_AGAIN) { if (!ao_packet_enable) break; @@ -35,7 +35,7 @@ ao_packet_getchar(void) static void ao_packet_echo(void) __reentrant { - char c; + int c; while (ao_packet_enable) { c = ao_packet_getchar(); if (c != AO_READ_AGAIN)