X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcortexelf-v1%2Fao_cortexelf.c;h=61a9d2199be2fcff5c62b0ccc98f814643797382;hb=4e561ae43a734d870470e36c41232482bd5f398f;hp=8be7ef151457acd362733157709f0684dd7ff159;hpb=1bc48b075f76bfef258f516549573429b24f284c;p=fw%2Faltos diff --git a/src/cortexelf-v1/ao_cortexelf.c b/src/cortexelf-v1/ao_cortexelf.c index 8be7ef15..61a9d219 100644 --- a/src/cortexelf-v1/ao_cortexelf.c +++ b/src/cortexelf-v1/ao_cortexelf.c @@ -30,6 +30,9 @@ #include #include #include +#include +#include +#include struct ao_task ball_task; @@ -200,6 +203,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 +225,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 +274,12 @@ main(void) ao_button_init(); + ao_as1107_init(); + ao_matrix_init(); + ao_1802_init(); + + ao_hex_init(); + ao_config_init(); ao_add_task(&ball_task, ao_ball, "ball");