X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fdrivers%2Fao_btm.c;h=b82fb999fe8957536c42bab002ebeda57161486b;hp=b7ff0b9edb4d383da76e414ae1b67baccc0bd1dc;hb=7fd29d922be98ddc6406f2323599ef63061044ed;hpb=5bdb250a43c9e87185f3ddedbd8364f24306bbfd diff --git a/src/drivers/ao_btm.c b/src/drivers/ao_btm.c index b7ff0b9e..b82fb999 100644 --- a/src/drivers/ao_btm.c +++ b/src/drivers/ao_btm.c @@ -29,7 +29,7 @@ #define ao_serial_btm_drain ao_serial1_drain #endif -int8_t ao_btm_stdio; +uint8_t ao_btm_stdio; uint8_t ao_btm_connected; #define BT_DEBUG 0 @@ -197,7 +197,7 @@ ao_btm_get_line(void) while ((c = ao_btm_getchar()) != AO_READ_AGAIN) { ao_btm_log_in_char(c); if (ao_btm_reply_len < sizeof (ao_btm_reply)) - ao_btm_reply[ao_btm_reply_len++] = c; + ao_btm_reply[ao_btm_reply_len++] = (char) c; if (c == '\r' || c == '\n') break; } @@ -242,7 +242,7 @@ ao_btm_putchar(char c) * Wait for the bluetooth device to return * status from the previously executed command */ -static uint8_t +static int ao_btm_wait_reply(void) { for (;;) { @@ -265,7 +265,7 @@ ao_btm_string(const char *cmd) ao_btm_putchar(c); } -static uint8_t +static int ao_btm_cmd(const char *cmd) { ao_btm_drain(); @@ -282,7 +282,7 @@ ao_btm_cmd(const char *cmd) return ao_btm_wait_reply(); } -static uint8_t +static int ao_btm_set_name(void) { char sn[8]; @@ -294,7 +294,7 @@ ao_btm_set_name(void) *--s = '\r'; n = ao_serial_number; do { - *--s = '0' + n % 10; + *--s = (uint8_t) ('0' + n % 10); } while (n /= 10); while ((c = *s++)) ao_btm_putchar(c);