aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/armcm_reset.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-18 11:26:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-09-18 11:59:43 -0400
commit1c6a8267f9514ee5d02948719acab7bae4407311 (patch)
tree63c1f913fc5cf9694375c42c13a367976961bcf5 /src/generic/armcm_reset.c
parent80e17b1e53801b13ec47a1fd8038641aa4be2e1d (diff)
downloadkutter-1c6a8267f9514ee5d02948719acab7bae4407311.tar.gz
kutter-1c6a8267f9514ee5d02948719acab7bae4407311.tar.xz
kutter-1c6a8267f9514ee5d02948719acab7bae4407311.zip
armcm_reset: Add a new helper file defining command_reset()
Add a generic ARM Cortex-M implementation of the "reset" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/generic/armcm_reset.c')
-rw-r--r--src/generic/armcm_reset.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/generic/armcm_reset.c b/src/generic/armcm_reset.c
new file mode 100644
index 00000000..19c2096d
--- /dev/null
+++ b/src/generic/armcm_reset.c
@@ -0,0 +1,15 @@
+// Generic reset command handler for ARM Cortex-M boards
+//
+// Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net>
+//
+// This file may be distributed under the terms of the GNU GPLv3 license.
+
+#include "board/internal.h" // NVIC_SystemReset
+#include "command.h" // DECL_COMMAND_FLAGS
+
+void
+command_reset(uint32_t *args)
+{
+ NVIC_SystemReset();
+}
+DECL_COMMAND_FLAGS(command_reset, HF_IN_SHUTDOWN, "reset");