drivers; counter: run clang-format on counter_timer_shell.c
Run clang-format on this file Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
3c97bf1014
commit
77e5bec398
1 changed files with 20 additions and 21 deletions
|
@ -16,9 +16,9 @@
|
||||||
#define ARGV_ONESHOT_TIME 3
|
#define ARGV_ONESHOT_TIME 3
|
||||||
|
|
||||||
/* number of periodic interrupts */
|
/* number of periodic interrupts */
|
||||||
#define PERIODIC_CYCLES 10
|
#define PERIODIC_CYCLES 10
|
||||||
#define MAX_DELAY UINT32_MAX
|
#define MAX_DELAY UINT32_MAX
|
||||||
#define MAX_CHANNEL 255U
|
#define MAX_CHANNEL 255U
|
||||||
|
|
||||||
static struct k_sem timer_sem;
|
static struct k_sem timer_sem;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ static void timer_top_handler(const struct device *counter_dev, void *user_data)
|
||||||
k_sem_give(&timer_sem);
|
k_sem_give(&timer_sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void timer_alarm_handler(const struct device *counter_dev, uint8_t chan_id,
|
static void timer_alarm_handler(const struct device *counter_dev, uint8_t chan_id, uint32_t ticks,
|
||||||
uint32_t ticks, void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(counter_dev);
|
ARG_UNUSED(counter_dev);
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ static int cmd_timer_free_running(const struct shell *shctx, size_t argc, char *
|
||||||
|
|
||||||
shell_info(shctx, "%s: Timer is freerunning", argv[ARGV_DEV]);
|
shell_info(shctx, "%s: Timer is freerunning", argv[ARGV_DEV]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_timer_stop(const struct shell *shctx, size_t argc, char **argv)
|
static int cmd_timer_stop(const struct shell *shctx, size_t argc, char **argv)
|
||||||
|
@ -215,20 +215,19 @@ static void device_name_get(size_t idx, struct shell_static_entry *entry)
|
||||||
|
|
||||||
SHELL_DYNAMIC_CMD_CREATE(dsub_device_name, device_name_get);
|
SHELL_DYNAMIC_CMD_CREATE(dsub_device_name, device_name_get);
|
||||||
|
|
||||||
SHELL_STATIC_SUBCMD_SET_CREATE(sub_timer,
|
SHELL_STATIC_SUBCMD_SET_CREATE(
|
||||||
SHELL_CMD_ARG(periodic, &dsub_device_name,
|
sub_timer,
|
||||||
"timer periodic <timer_instance_node_id> <time_in_us>",
|
SHELL_CMD_ARG(periodic, &dsub_device_name,
|
||||||
cmd_timer_periodic, 3, 0),
|
"timer periodic <timer_instance_node_id> <time_in_us>", cmd_timer_periodic, 3,
|
||||||
SHELL_CMD_ARG(oneshot, &dsub_device_name,
|
0),
|
||||||
"timer oneshot <timer_instance_node_id> <channel_id> <time_in_us>",
|
SHELL_CMD_ARG(oneshot, &dsub_device_name,
|
||||||
cmd_timer_oneshot, 4, 0),
|
"timer oneshot <timer_instance_node_id> <channel_id> <time_in_us>",
|
||||||
SHELL_CMD_ARG(freerun, &dsub_device_name,
|
cmd_timer_oneshot, 4, 0),
|
||||||
"timer freerun <timer_instance_node_id>",
|
SHELL_CMD_ARG(freerun, &dsub_device_name, "timer freerun <timer_instance_node_id>",
|
||||||
cmd_timer_free_running, 2, 0),
|
cmd_timer_free_running, 2, 0),
|
||||||
SHELL_CMD_ARG(stop, &dsub_device_name,
|
SHELL_CMD_ARG(stop, &dsub_device_name, "timer stop <timer_instance_node_id>",
|
||||||
"timer stop <timer_instance_node_id>",
|
cmd_timer_stop, 2, 0),
|
||||||
cmd_timer_stop, 2, 0),
|
SHELL_SUBCMD_SET_END /* array terminated. */
|
||||||
SHELL_SUBCMD_SET_END /* array terminated. */
|
);
|
||||||
);
|
|
||||||
|
|
||||||
SHELL_CMD_REGISTER(timer, &sub_timer, "Timer commands", NULL);
|
SHELL_CMD_REGISTER(timer, &sub_timer, "Timer commands", NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue