summaryrefslogtreecommitdiff
path: root/src/app_console
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-09-29 12:34:27 +1000
committerjacqueline <me@jacqueline.id.au>2023-09-29 12:34:27 +1000
commitc53802f308f57f0d829f5a02baf9e9fe8219c301 (patch)
treed9001b9ccb57b59da06577b6678491a3b8d93cc5 /src/app_console
parentc876c006547a5dfa44457fd324a123ac193a2e2a (diff)
downloadtangara-fw-c53802f308f57f0d829f5a02baf9e9fe8219c301.tar.gz
Add a core dump command
Diffstat (limited to 'src/app_console')
-rw-r--r--src/app_console/app_console.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp
index 04f1866d..b4fef130 100644
--- a/src/app_console/app_console.cpp
+++ b/src/app_console/app_console.cpp
@@ -8,6 +8,7 @@
#include <dirent.h>
#include <stdint.h>
+#include <sys/_stdint.h>
#include <algorithm>
#include <cstdint>
@@ -624,6 +625,27 @@ void RegisterSamd() {
esp_console_cmd_register(&cmd);
}
+int CmdCoreDump(int argc, char** argv) {
+ static const std::pmr::string usage = "usage: core_dump";
+ if (argc != 1) {
+ std::cout << usage << std::endl;
+ return 1;
+ }
+
+ abort();
+
+ return 0;
+}
+
+void RegisterCoreDump() {
+ esp_console_cmd_t cmd{.command = "core_dump",
+ .help = "",
+ .hint = NULL,
+ .func = &CmdCoreDump,
+ .argtable = NULL};
+ esp_console_cmd_register(&cmd);
+}
+
auto AppConsole::RegisterExtraComponents() -> void {
RegisterListDir();
RegisterPlayFile();
@@ -646,6 +668,7 @@ auto AppConsole::RegisterExtraComponents() -> void {
RegisterBtList();
RegisterSamd();
+ RegisterCoreDump();
}
} // namespace console