altos: fix functions calling pollchar to use 'int' to hold the value
authorKeith Packard <keithp@keithp.com>
Fri, 7 Dec 2012 18:05:51 +0000 (10:05 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 7 Dec 2012 18:12:19 +0000 (10:12 -0800)
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>
src/cc1111/ao_usb.c
src/core/ao_stdio.c
src/drivers/ao_btm.c
src/drivers/ao_packet_master.c

index 81e9074ea44c6905274cb0ac72fff96cffccacb0..f66e807cf7bf13e2d9c774a56645cde6fca4923a 100644 (file)
@@ -411,7 +411,7 @@ ao_usb_getchar(void) __critical
 {
        int     c;
 
 {
        int     c;
 
-       while ((c = ao_usb_pollchar()) == -1)
+       while ((c = ao_usb_pollchar()) == AO_READ_AGAIN)
                ao_sleep(&ao_stdin_ready);
        return c;
 }
                ao_sleep(&ao_stdin_ready);
        return c;
 }
index 4a832487e6102612c7aeed176247d75c981fd3d9..1748dfe8d940ecc550ff41911db01b0259291ec9 100644 (file)
@@ -98,7 +98,7 @@ __xdata uint8_t ao_stdin_ready;
 char
 getchar(void) __reentrant
 {
 char
 getchar(void) __reentrant
 {
-       char c;
+       int c;
        ao_arch_critical(
                int8_t stdio = ao_cur_stdio;
 
        ao_arch_critical(
                int8_t stdio = ao_cur_stdio;
 
index f381604796dd3d390aae7469fce3df611782e49a..c862200a8fe01232f199777abe434d2ab4160b49 100644 (file)
@@ -120,7 +120,7 @@ uint8_t
 ao_btm_get_line(void)
 {
        uint8_t ao_btm_reply_len = 0;
 ao_btm_get_line(void)
 {
        uint8_t ao_btm_reply_len = 0;
-       char c;
+       int c;
 
        for (;;) {
 
 
        for (;;) {
 
index 481232dff2b821b229c29dc4ff6f8baad63f41db..023c788ba86c4be6c0d8d0efcc548f5e8df973e3 100644 (file)
@@ -20,7 +20,7 @@
 static char
 ao_packet_getchar(void)
 {
 static char
 ao_packet_getchar(void)
 {
-       char c;
+       int c;
        while ((c = ao_packet_pollchar()) == AO_READ_AGAIN) {
                if (!ao_packet_enable)
                        break;
        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
 {
 static void
 ao_packet_echo(void) __reentrant
 {
-       char    c;
+       int     c;
        while (ao_packet_enable) {
                c = ao_packet_getchar();
                if (c != AO_READ_AGAIN)
        while (ao_packet_enable) {
                c = ao_packet_getchar();
                if (c != AO_READ_AGAIN)