add get_system_status command

This commit is contained in:
Filip Ayazi 2023-03-09 00:06:55 +00:00
parent 1b3e251783
commit 11f0f12ee1

View file

@ -60,6 +60,7 @@ const Command core_commands[] = {
{"version", get_version}, {"version", get_version},
{"list_modules", get_modules}, {"list_modules", get_modules},
{"eeprom_last_commit", get_eeprom_last_commit}, {"eeprom_last_commit", get_eeprom_last_commit},
{"system_status", get_system_status},
END_COMMAND}; END_COMMAND};
void register_module(const Command commands[], void (*loop_fn)(void)) void register_module(const Command commands[], void (*loop_fn)(void))
@ -171,6 +172,16 @@ void get_eeprom_last_commit(String)
return; return;
} }
void get_system_status(String)
{
comPort->println(F(BOARD_STRING));
comPort->println(F(VERSION_STRING));
#ifdef MCU_PICO
comPort->print(F("Heap remaining:"));
comPort->println(rp2040.getFreeHeap());
#endif
}
#ifndef UNIT_TEST // don't define setup() and loop() for unit testing #ifndef UNIT_TEST // don't define setup() and loop() for unit testing
void setup() void setup()
{ {
@ -199,7 +210,6 @@ void setup()
delay(1); delay(1);
register_module(core_commands, NULL); register_module(core_commands, NULL);
#ifdef HELP #ifdef HELP
help_setup(); help_setup();
#endif #endif