diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-07-10 15:18:33 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-07-10 15:18:33 +1000 |
| commit | 11bddb1b1da603a7d6c0e9f239eb89fb724be08e (patch) | |
| tree | 096d6a7301cb65101915c363c45b31d88d20adaf /src/tangara/dev_console/console.cpp | |
| parent | 53798f4a6191b9606ebf8a1dec1b447455081a66 (diff) | |
| download | tangara-fw-11bddb1b1da603a7d6c0e9f239eb89fb724be08e.tar.gz | |
add a console command for dumping intr allocations
Diffstat (limited to 'src/tangara/dev_console/console.cpp')
| -rw-r--r-- | src/tangara/dev_console/console.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tangara/dev_console/console.cpp b/src/tangara/dev_console/console.cpp index a7f7a721..fcb987bb 100644 --- a/src/tangara/dev_console/console.cpp +++ b/src/tangara/dev_console/console.cpp @@ -13,6 +13,7 @@ #include <string> #include "esp_console.h" +#include "esp_intr_alloc.h" #include "esp_log.h" #include "esp_system.h" @@ -66,12 +67,34 @@ void RegisterLogLevel() { esp_console_cmd_register(&cmd); } +int CmdInterrupts(int argc, char** argv) { + static const std::pmr::string usage = "usage: intr"; + if (argc != 1) { + std::cout << usage << std::endl; + return 1; + } + esp_intr_dump(NULL); + return 0; +} + +void RegisterInterrupts() { + esp_console_cmd_t cmd{.command = "intr", + .help = "Dumps a table of all allocated interrupts", + .hint = NULL, + .func = &CmdInterrupts, + .argtable = NULL}; + esp_console_cmd_register(&cmd); + cmd.command = "interrupts"; + esp_console_cmd_register(&cmd); +} + Console::Console() {} Console::~Console() {} auto Console::RegisterCommonComponents() -> void { esp_console_register_help_command(); RegisterLogLevel(); + RegisterInterrupts(); } static Console* sInstance; |
