diff options
author | Keith Packard <keithp@keithp.com> | 2017-04-02 17:39:26 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-04-02 17:39:26 -0700 |
commit | 17ec1c510ccc42bbc387940b5805f452697f78d6 (patch) | |
tree | d26a4833366d936c1da2543b343e300d1ea85cf2 /src/cortexelf-v1/ao_cortexelf.c | |
parent | cc1b56faa88c75c9c86af89c77d7f1349573b7b0 (diff) |
cortexelf-v1: Hook up AS1107 in test mode
Provide a 'L' command to display values
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 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cortexelf-v1/ao_cortexelf.c b/src/cortexelf-v1/ao_cortexelf.c index 8be7ef15..77fbd0c0 100644 --- a/src/cortexelf-v1/ao_cortexelf.c +++ b/src/cortexelf-v1/ao_cortexelf.c @@ -30,6 +30,7 @@ #include <ao_lisp.h> #include <ao_button.h> #include <ao_event.h> +#include <ao_as1107.h> struct ao_task ball_task; @@ -200,6 +201,21 @@ ao_serial_blather(void) } } +static void +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; + if (ao_cmd_status != ao_cmd_success) + return; + ao_as1107_write_8(start, value); +} + __code struct ao_cmds ao_demo_cmds[] = { { ao_video_toggle, "V\0Toggle video" }, { ao_ball_toggle, "B\0Toggle ball" }, @@ -207,6 +223,7 @@ __code struct ao_cmds ao_demo_cmds[] = { { ao_console_send, "C\0Send data to console, end with ~" }, { ao_serial_blather, "S\0Blather on serial ports briefly" }, { lisp_cmd, "l\0Run lisp interpreter" }, + { led_cmd, "L start value\0Show value (byte) at digit start" }, { 0, NULL } }; @@ -255,6 +272,8 @@ main(void) ao_button_init(); + ao_as1107_init(); + ao_config_init(); ao_add_task(&ball_task, ao_ball, "ball"); |