You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
471 B
32 lines
471 B
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#if 0
|
|
#include <libopencm3/stm32/gpio.h>
|
|
#endif
|
|
|
|
#include <console.h>
|
|
#include <rtc.h>
|
|
|
|
int shell_alarm(struct console *con, size_t argc, const char **argv)
|
|
{
|
|
int state = 0;
|
|
uint32_t timeout = 10;
|
|
|
|
(void)con;
|
|
|
|
if (argc >= 2)
|
|
timeout = strtoul(argv[0], NULL, 0);
|
|
|
|
if (argc >= 1)
|
|
state = (strcmp(argv[1], "on") == 0);
|
|
|
|
if (state) {
|
|
alarm_enable(timeout);
|
|
} else {
|
|
alarm_disable();
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|