altos/test: Adjust CRC error rate after FEC fix
[fw/altos] / src / lambdakey-v1.0 / ao_lambdakey.c
1 /*
2  * Copyright © 2016 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 #include <ao.h>
16 #include <ao_scheme.h>
17
18 static void scheme_cmd(void) {
19         ao_scheme_read_eval_print(stdin, stdout, false);
20 }
21
22 static const struct ao_cmds blink_cmds[] = {
23         { scheme_cmd,   "l\0Run scheme interpreter" },
24         { 0, 0 }
25 };
26
27 int
28 _ao_scheme_getc(void)
29 {
30         static uint8_t  at_eol;
31         int c;
32
33         if (at_eol) {
34                 ao_cmd_readline(ao_scheme_read_list ? "Λ " : "λ ");
35                 at_eol = 0;
36         }
37         c = (unsigned char) ao_cmd_lex();
38         if (c == '\n')
39                 at_eol = 1;
40         return c;
41 }
42
43 void main(void)
44 {
45 #ifdef LEDS_AVAILABLE
46         ao_led_init();
47 #endif
48         ao_clock_init();
49         ao_timer_init();
50         ao_usb_init();
51         ao_cmd_init();
52         ao_cmd_register(blink_cmds);
53         ao_cmd();
54 }
55
56