altos: Make cmd number parsing functions return value
[fw/altos] / src / cortexelf-v1 / ao_cortexelf.c
index 6bc2624fb06e1a006ff1f1c92a8b77b6ff099bd1..1c30cd85dda20a768642261c9a2d826c186ba07f 100644 (file)
@@ -149,17 +149,16 @@ ao_fb_init(void)
 static void
 ao_video_toggle(void)
 {
 static void
 ao_video_toggle(void)
 {
-       ao_cmd_decimal();
-       if (ao_cmd_lex_i)
+       uint16_t r = ao_cmd_decimal();
+       if (r)
                ao_fb_init();
                ao_fb_init();
-       ao_vga_enable(ao_cmd_lex_i);
+       ao_vga_enable(r)
 }
 
 static void
 ao_ball_toggle(void)
 {
 }
 
 static void
 ao_ball_toggle(void)
 {
-       ao_cmd_decimal();
-       ball_enable = ao_cmd_lex_i;
+       ball_enable = ao_cmd_decimal();
        ao_wakeup(&ball_enable);
 }
 
        ao_wakeup(&ball_enable);
 }
 
@@ -208,11 +207,9 @@ led_cmd(void)
 {
        uint8_t start;
        uint8_t value;
 {
        uint8_t start;
        uint8_t value;
-       ao_cmd_decimal();
 
 
-       start = ao_cmd_lex_i;
-       ao_cmd_hex();
-       value = ao_cmd_lex_i;
+       start = ao_cmd_decimal();
+       value = ao_cmd_hex();
        if (ao_cmd_status != ao_cmd_success)
                return;
        ao_as1107_write_8(start, value);
        if (ao_cmd_status != ao_cmd_success)
                return;
        ao_as1107_write_8(start, value);