main: initialize buzzers and add shell commands
This commit is contained in:
parent
56f2870fa4
commit
928487b58e
1 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <buzzer.h>
|
||||
#include <console.h>
|
||||
#include <gpio.h>
|
||||
#include <flash.h>
|
||||
|
@ -13,6 +14,7 @@
|
|||
#include <shell.h>
|
||||
|
||||
#include <shell/boot.h>
|
||||
#include <shell/buzzer.h>
|
||||
#include <shell/echo.h>
|
||||
#include <shell/mufs.h>
|
||||
#include <shell/rtc.h>
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue