diff options
author | Keith Packard <keithp@keithp.com> | 2012-12-07 10:05:51 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-12-07 10:12:19 -0800 |
commit | c10f9a438ed5789479d21c78153ca7f14c05534c (patch) | |
tree | f92e652d2d478da3636d7cf77383df1e1f08c7c5 | |
parent | 16fd9009d8b034fd8d208115317f65fabe10072a (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | src/cc1111/ao_usb.c | 2 | ||||
-rw-r--r-- | src/core/ao_stdio.c | 2 | ||||
-rw-r--r-- | src/drivers/ao_btm.c | 2 | ||||
-rw-r--r-- | src/drivers/ao_packet_master.c | 4 |
4 files changed, 5 insertions, 5 deletions
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) |