summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-02-20 17:34:43 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 17:35:51 -0800
commitd1c2a5729da00be9d393015bbaa2d2f58e936d84 (patch)
tree495502ad76d08a9c8a622ed090776ddeb40ab747
parentd1956000ba2e6260977aa669475d3ff725578b55 (diff)
altos/nucleo-32: Update lisp files, add beeper support
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/nucleao-32/Makefile18
-rw-r--r--src/nucleao-32/ao_nucleo.c7
-rw-r--r--src/nucleao-32/ao_pins.h7
3 files changed, 23 insertions, 9 deletions
diff --git a/src/nucleao-32/Makefile b/src/nucleao-32/Makefile
index 57fb4cde..69049982 100644
--- a/src/nucleao-32/Makefile
+++ b/src/nucleao-32/Makefile
@@ -27,6 +27,7 @@ ALTOS_SRC = \
ao_config.c \
ao_task.c \
ao_led.c \
+ ao_beep_stm.c \
ao_dma_stm.c \
ao_stdio.c \
ao_panic.c \
@@ -35,21 +36,22 @@ ALTOS_SRC = \
ao_usb_stm.c \
ao_serial_stm.c \
ao_flash_stm.c \
- ao_lisp_lex.c \
- ao_lisp_mem.c \
+ ao_lisp_atom.c \
+ ao_lisp_builtin.c \
ao_lisp_cons.c \
+ ao_lisp_error.c \
ao_lisp_eval.c \
- ao_lisp_string.c \
- ao_lisp_atom.c \
+ ao_lisp_frame.c \
ao_lisp_int.c \
+ ao_lisp_lambda.c \
+ ao_lisp_lex.c \
+ ao_lisp_mem.c \
ao_lisp_poly.c \
- ao_lisp_builtin.c \
ao_lisp_read.c \
ao_lisp_rep.c \
- ao_lisp_frame.c \
- ao_lisp_error.c \
- ao_lisp_lambda.c \
ao_lisp_save.c \
+ ao_lisp_stack.c \
+ ao_lisp_string.c \
ao_lisp_os_save.c
PRODUCT=Nucleo-32
diff --git a/src/nucleao-32/ao_nucleo.c b/src/nucleao-32/ao_nucleo.c
index 3e448865..6b4cbaae 100644
--- a/src/nucleao-32/ao_nucleo.c
+++ b/src/nucleao-32/ao_nucleo.c
@@ -14,13 +14,19 @@
#include <ao.h>
#include <ao_lisp.h>
+#include <ao_beep.h>
static void lisp_cmd() {
ao_lisp_read_eval_print();
}
+static void beep() {
+ ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(200));
+}
+
static const struct ao_cmds blink_cmds[] = {
{ lisp_cmd, "l\0Run lisp interpreter" },
+ { beep, "b\0Beep" },
{ 0, 0 }
};
@@ -33,6 +39,7 @@ void main(void)
ao_dma_init();
ao_usb_init();
ao_serial_init();
+ ao_beep_init();
ao_cmd_init();
ao_cmd_register(blink_cmds);
ao_start_scheduler();
diff --git a/src/nucleao-32/ao_pins.h b/src/nucleao-32/ao_pins.h
index e631db7b..cee4616f 100644
--- a/src/nucleao-32/ao_pins.h
+++ b/src/nucleao-32/ao_pins.h
@@ -47,7 +47,12 @@
#define HAS_USB 1
#define AO_USB_DIRECTIO 0
#define AO_PA11_PA12_RMP 0
-#define HAS_BEEP 0
+#define HAS_BEEP 1
+
+#define BEEPER_TIMER 2
+#define BEEPER_CHANNEL 4
+#define BEEPER_PORT (&stm_gpioa)
+#define BEEPER_PIN 3
#define IS_FLASH_LOADER 0