2024A-SW/components/Serial_Console/Console.c
Joe Kearney 2c81bdd052 Added a new console command: "system" (#14)
```
KTag> system
Usage:
  system chip-info      - Show chip and system information
  system coredump       - Check coredump status
  system factory-reset  - Clear NVS and restart
  system flash          - Show flash information
  system heap-caps      - Show heap by capability
  system hostname [name]- Show/set hostname
  system mac            - Show MAC addresses
  system partition      - List partition table
  system RAM            - Display heap memory usage
  system reboot         - Reboot the device
  system reset-reason   - Show last reset reason
  system stats          - Combined system statistics
  system tasks          - List FreeRTOS tasks
  system uptime         - Display system uptime
  system version        - Show firmware version
```

Co-authored-by: Joe Kearney <joe@clubk.club>
Reviewed-on: #14
2026-01-17 16:33:41 +00:00

50 lines
No EOL
1.6 KiB
C

/*
* This program source code file is part of the KTag project, a DIY laser tag
* game with customizable features and wide interoperability.
*
* 🛡 <https://ktag.clubk.club> 🃞
*
* Copyright © 2026 Joseph P. Kearney and the KTag developers.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* There should be a copy of the GNU Affero General Public License in the LICENSE
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
*/
#include "esp_console.h"
#include <Log_Command.h>
#include <System_Command.h>
static void register_commands()
{
Register_Log_Command();
Register_System_Command();
esp_console_register_help_command();
}
void Initialize_Console(void)
{
esp_console_repl_t *repl = NULL;
esp_console_repl_config_t repl_cfg = ESP_CONSOLE_REPL_CONFIG_DEFAULT();
repl_cfg.prompt = "KTag>";
repl_cfg.max_cmdline_length = 1024;
repl_cfg.max_history_len = 16;
register_commands();
esp_console_dev_uart_config_t hw_cfg =
ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
ESP_ERROR_CHECK(
esp_console_new_repl_uart(&hw_cfg, &repl_cfg, &repl));
ESP_ERROR_CHECK(esp_console_start_repl(repl));
}