diff options
author | Keith Packard <keithp@keithp.com> | 2018-08-15 19:13:45 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2018-10-13 08:22:50 -0700 |
commit | c417ab1de2a083b5fcff2e081e4feb2a65887903 (patch) | |
tree | 614c7564321ea38402883992daeaea8f30bfe6b1 /src/cortexelf-v1/ao_cortexelf.c | |
parent | c6e57291d91f1f6c4de5c54a5cfd3eef66d9f830 (diff) |
altos: Make cmd number parsing functions return value
Don't use a global variable to hold the result.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/cortexelf-v1/ao_cortexelf.c')
-rw-r--r-- | src/cortexelf-v1/ao_cortexelf.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/cortexelf-v1/ao_cortexelf.c b/src/cortexelf-v1/ao_cortexelf.c index 6bc2624f..1c30cd85 100644 --- a/src/cortexelf-v1/ao_cortexelf.c +++ b/src/cortexelf-v1/ao_cortexelf.c @@ -149,17 +149,16 @@ ao_fb_init(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_vga_enable(ao_cmd_lex_i); + ao_vga_enable(r) } static void ao_ball_toggle(void) { - ao_cmd_decimal(); - ball_enable = ao_cmd_lex_i; + ball_enable = ao_cmd_decimal(); ao_wakeup(&ball_enable); } @@ -208,11 +207,9 @@ led_cmd(void) { 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); |