aboutsummaryrefslogtreecommitdiff
path: root/board/simple_board.h
diff options
context:
space:
mode:
Diffstat (limited to 'board/simple_board.h')
-rw-r--r--board/simple_board.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/board/simple_board.h b/board/simple_board.h
new file mode 100644
index 0000000..9d9836b
--- /dev/null
+++ b/board/simple_board.h
@@ -0,0 +1,33 @@
+#include "board.h"
+
+static struct board_data board_data;
+
+void board_on_down(void)
+{
+#ifdef BOARD_DOWN_WAV
+ board_data.sound_play(BOARD_DOWN_WAV);
+#endif
+}
+
+void board_on_up(void)
+{
+#ifdef BOARD_UP_WAV
+ board_data.sound_play(BOARD_UP_WAV);
+#endif
+}
+
+static struct board board = {
+ .on_down = &board_on_down,
+ .on_up = &board_on_up,
+#ifdef BOARD_NAME
+ .name = BOARD_NAME,
+#else
+ .name = "Generic Board",
+#endif
+};
+
+struct board *board_init(struct board_data data)
+{
+ board_data = data;
+ return &board;
+} \ No newline at end of file