altos-avr: Enable command processor over serial line in demo
authorKeith Packard <keithp@keithp.com>
Fri, 13 May 2011 08:33:49 +0000 (01:33 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 13 May 2011 08:33:49 +0000 (01:33 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
src-avr/ao_cmd.c
src-avr/ao_demo.c
src-avr/ao_product.c
src-avr/avr-demo/Makefile

index 86ec1fe00cadccfe1ac94bcffbfb37f1cadffa47..131c3d8934af11a32e82e9b8755e5d06ca590ee7 100644 (file)
@@ -32,7 +32,7 @@ static void
 put_string(char *s)
 {
        __xdata char    c;
-       while (c = *s++)
+       while ((c = *s++))
                putchar(c);
 }
 
@@ -186,12 +186,14 @@ ao_match_word(__code char *word)
        return 1;
 }
 
+#if 0
 static void
 eol(void)
 {
        while (ao_cmd_lex_c != '\n')
                ao_cmd_lex();
 }
+#endif
 
 static void
 echo(void)
@@ -220,7 +222,7 @@ version(void)
 {
        printf("manufacturer     %s\n", ao_manufacturer);
        printf("product          %s\n", ao_product);
-       printf("serial-number    %u\n", ao_romconfig.serial_number);
+//     printf("serial-number    %u\n", ao_romconfig.serial_number);
        printf("software-version %s\n", ao_version);
 }
 
@@ -255,6 +257,7 @@ report(void)
        case ao_cmd_syntax_error:
                puts("Syntax error");
                ao_cmd_status = 0;
+       default:
                break;
        }
 }
index 3f25be509d1c6234d4f8d64e95c9978ab2fc7a2a..a9632080b7a2f5842bd5b61a46cdf87f4e1a4a40 100644 (file)
@@ -40,8 +40,9 @@ main(void)
 //     ao_debug_init();
        ao_led_init(LEDS_AVAILABLE);
        ao_timer_init();
+       ao_cmd_init();
 
-       ao_add_task(&demo_task, ao_demo, "demo");
+//     ao_add_task(&demo_task, ao_demo, "demo");
        /* Turn on the LED until the system is stable */
        ao_start_scheduler();
        return 0;
index 54ba2a14e993b85017c0f203e22191e2f82e9bca..420f14db259df87509a2c6c20ef7ac1199a8ae59 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include "ao.h"
-#include PRODUCT_DEFS
+#include "ao_product.h"
 
 /* Defines which mark this particular AltOS product */
 
index 49824ca599216f6dc868e7cf2d731eb4a6c720a6..ba30adfc9645fd43fbbd28f035765686c356c81b 100644 (file)
@@ -35,8 +35,10 @@ INC = \
 # Common AltOS sources
 #
 ALTOS_SRC = \
+       ao_cmd.c \
        ao_mutex.c \
        ao_panic.c \
+       ao_product.c \
        ao_serial_avr.c \
        ao_stdio.c \
        ao_task.c \
@@ -96,4 +98,4 @@ install:
 
 uninstall:
 
-$(OBJ): ao.h
\ No newline at end of file
+$(OBJ): ao.h ao_product.h
\ No newline at end of file