fix compilation with latest aversive
[protos/xbee-avr.git] / cmdline.c
index 60dc9a6..d9fd836 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
 #endif
 
 
 #endif
 
 
-extern parse_pgm_ctx_t main_ctx[];
+extern const parse_ctx_t PROGMEM main_ctx[];
+
 
 int cmdline_dev_send(char c, FILE* f)
 {
 
 int cmdline_dev_send(char c, FILE* f)
 {
+       (void)f;
 #ifdef USE_USB
        CDC_Device_SendByte(&VirtualSerial1_CDC_Interface, (uint8_t)c);
 #else
 #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;
 int cmdline_dev_recv(FILE* f)
 {
        int16_t c;
+
+       (void)f;
 #ifdef USE_USB
        /* non-blocking ! */
        c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
 #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)
 {
 
 int xbee_dev_send(char c, FILE* f)
 {
+       (void)f;
 #ifdef USE_USB
        CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, (uint8_t)c);
 #else
 #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;
 
 {
        int16_t c;
 
+       (void)f;
 #ifdef USE_USB
        /* non-blocking ! */
        c = CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface);
 #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;
 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)
        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)
 {
 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);
 }
 
 
 }