X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=cmdline.c;h=d9fd8367c2a015e1c3df2e498d973149f13302dd;hp=60dc9a693f70da836d6d15e418ff47541d5a39d5;hb=57895b3bb2fe0582c589685b7df34f3968b346ec;hpb=9a9b64112aee5ab26398b46cb13b7e49c292a355 diff --git a/cmdline.c b/cmdline.c index 60dc9a6..d9fd836 100644 --- a/cmdline.c +++ b/cmdline.c @@ -42,10 +42,12 @@ #endif -extern parse_pgm_ctx_t main_ctx[]; +extern const parse_ctx_t PROGMEM main_ctx[]; + int cmdline_dev_send(char c, FILE* f) { + (void)f; #ifdef USE_USB CDC_Device_SendByte(&VirtualSerial1_CDC_Interface, (uint8_t)c); #else @@ -57,6 +59,8 @@ int cmdline_dev_send(char c, FILE* f) int cmdline_dev_recv(FILE* f) { int16_t c; + + (void)f; #ifdef USE_USB /* non-blocking ! */ c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface); @@ -72,6 +76,7 @@ int cmdline_dev_recv(FILE* f) int xbee_dev_send(char c, FILE* f) { + (void)f; #ifdef USE_USB CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, (uint8_t)c); #else @@ -84,6 +89,7 @@ int xbee_dev_recv(FILE* f) { int16_t c; + (void)f; #ifdef USE_USB /* non-blocking ! */ c = CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface); @@ -100,8 +106,10 @@ static void valid_buffer(const char *buf, uint8_t size) { int8_t ret; + PGM_P ctx = (PGM_P)main_ctx; - ret = parse(main_ctx, buf); + (void)size; + ret = parse(ctx, buf); if (ret == PARSE_AMBIGUOUS) printf_P(PSTR("Ambiguous command\r\n")); else if (ret == PARSE_NOMATCH) @@ -114,7 +122,8 @@ static int8_t complete_buffer(const char *buf, char *dstbuf, uint8_t dstsize, int16_t *state) { - return complete(main_ctx, buf, state, dstbuf, dstsize); + PGM_P ctx = (PGM_P)main_ctx; + return complete(ctx, buf, state, dstbuf, dstsize); }