Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[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() {
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
28 void main(void)
29 {
30 #ifdef LEDS_AVAILABLE
31         ao_led_init(LEDS_AVAILABLE);
32 #endif
33         ao_clock_init();
34         ao_timer_init();
35         ao_usb_init();
36         ao_cmd_init();
37         ao_cmd_register(blink_cmds);
38         ao_cmd();
39 }
40
41