cortexelf-v1: Add serialblather command.
[fw/altos] / src / cortexelf-v1 / ao_cortexelf.c
index 776530e0c9a9a28c5ee82402656dd0c156d34160..f9be59e835a11e7e78be52493f95f2cefac4b8c6 100644 (file)
@@ -25,6 +25,9 @@
 #include <ao_ps2.h>
 #include <ao_vga.h>
 #include <ao_console.h>
+#include <ao_sdcard.h>
+#include <ao_fat.h>
+#include <ao_lisp.h>
 
 struct ao_task ball_task;
 
@@ -180,11 +183,28 @@ ao_console_send(void)
        }
 }
 
+static void lisp_cmd() {
+       ao_lisp_read_eval_print();
+}
+
+static void
+ao_serial_blather(void)
+{
+       char c;
+
+       while ((c = getchar()) != '~') {
+               ao_serial1_putchar(c);
+               ao_serial2_putchar(c);
+       }
+}
+
 __code struct ao_cmds ao_demo_cmds[] = {
        { ao_video_toggle, "V\0Toggle video" },
        { ao_ball_toggle, "B\0Toggle ball" },
        { ao_ps2_read_keys, "K\0Read keys from keyboard" },
        { 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" },
        { 0, NULL }
 };
 
@@ -205,6 +225,9 @@ main(void)
        ao_dma_init();
        ao_exti_init();
 
+       ao_sdcard_init();
+       ao_fat_init();
+
        ao_ps2_init();
        ao_vga_init();
        ao_console_init();