summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-05 15:38:39 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-05 15:38:39 +0100
commitf7e18ccf8b09972c965abd6c55a5986a36c7e52c (patch)
tree863e9b4c7c7cca63f233d7ea796ebdca847b1397
parent45f9258c7fc11e145b5197a076bedf935ace9249 (diff)
sw: use the SHELL_REGISTER_CMDS macro
-rw-r--r--src/sw.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/sw.c b/src/sw.c
index fc253a4..2d44fd3 100644
--- a/src/sw.c
+++ b/src/sw.c
@@ -277,19 +277,11 @@ static struct shell_cmd shell_cmds[] = {
void
sw_setup(void)
{
- int error;
-
sw_instance = sw_create();
if (!sw_instance) {
panic("sw: error: unable to create stopwatch");
}
- for (size_t i = 0; i < ARRAY_SIZE(shell_cmds); i++) {
- error = shell_cmd_register(&shell_cmds[i]);
-
- if (error) {
- panic("unable to register shell command");
- }
- }
+ SHELL_REGISTER_CMDS(shell_cmds);
}