From 928487b58eb78198fbbaeae0307fe5ecb79c765f Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Tue, 31 Oct 2017 11:59:48 +0100 Subject: [PATCH] main: initialize buzzers and add shell commands --- source/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/main.c b/source/main.c index a6f6888..86236bb 100644 --- a/source/main.c +++ b/source/main.c @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -13,6 +14,7 @@ #include #include +#include #include #include #include @@ -23,9 +25,12 @@ struct shell user_shell, admin_shell; extern struct flash_dev *flash; extern struct mufs *mufs; +extern struct buzzer buzzers[]; +extern size_t nbuzzers; struct cmd user_cmds[] = { { "hi", "", shell_version }, + { "buzzer", "", shell_buzzer }, { "cat", "", shell_cat }, { "ls", "", shell_ls }, { "date", "", shell_date }, @@ -36,21 +41,29 @@ struct cmd user_cmds[] = { struct cmd admin_cmds[] = { { "echo", "", shell_echo }, + { "buzzer", "", shell_buzzer }, { "flash", "", do_flash_cmd }, { "ftl", "", do_ftl_cmd }, { "mufs", "", do_mufs_cmd }, { "date", "", shell_date }, { "time", "", shell_time }, { "set-date", "", shell_set_date }, + { "set-time", "", shell_set_time }, { NULL, NULL, NULL }, }; int main(void) { + size_t i; + rcc_init(); gpio_init(); rtc_init(NULL); + for (i = 0; i < nbuzzers; ++i) { + buzzer_init(buzzers + i); + } + user_con = console_init(1); admin_con = console_init(0);