X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Flambdakey-v1.0%2Fao_lambdakey.c;h=c50317c01a5fbea013257bcc1b292cdd729252e2;hp=8bd344cf57139fe47f9264e7e2f6cf6514e34e2a;hb=0e8970c7f4eb7e8dd4ef325e4db4fe7412d0ed78;hpb=5161f6d78647591cc7ab8774a04edbc68a09f689 diff --git a/src/lambdakey-v1.0/ao_lambdakey.c b/src/lambdakey-v1.0/ao_lambdakey.c index 8bd344cf..c50317c0 100644 --- a/src/lambdakey-v1.0/ao_lambdakey.c +++ b/src/lambdakey-v1.0/ao_lambdakey.c @@ -13,29 +13,44 @@ */ #include -#include +#include -static void lisp_cmd() { - ao_lisp_read_eval_print(); +static void scheme_cmd(void) { + ao_scheme_read_eval_print(stdin, stdout, false); } static const struct ao_cmds blink_cmds[] = { - { lisp_cmd, "l\0Run lisp interpreter" }, + { scheme_cmd, "l\0Run scheme interpreter" }, { 0, 0 } }; +int +_ao_scheme_getc(void) +{ + static uint8_t at_eol; + int c; + + if (at_eol) { + ao_cmd_readline(ao_scheme_read_list ? "Λ " : "λ "); + at_eol = 0; + } + c = (unsigned char) ao_cmd_lex(); + if (c == '\n') + at_eol = 1; + return c; +} void main(void) { - ao_led_init(LEDS_AVAILABLE); +#ifdef LEDS_AVAILABLE + ao_led_init(); +#endif ao_clock_init(); - ao_task_init(); ao_timer_init(); - ao_dma_init(); ao_usb_init(); ao_cmd_init(); ao_cmd_register(blink_cmds); - ao_start_scheduler(); + ao_cmd(); }