reboot kommando

This commit is contained in:
Carsten Keller 2024-06-09 17:58:17 +02:00
parent 6b980f97ba
commit 5dc70bde82
Signed by: carsten
GPG Key ID: DF06343A3A9B8868

View File

@ -35,6 +35,7 @@ uint16_t set_dutyCyle (CLI_OutFunction pfvOutFunction, char *acCommands[], uint1
uint16_t ist_werte(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount); uint16_t ist_werte(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount);
uint16_t set_ucall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount); uint16_t set_ucall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount);
uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount); uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount);
uint16_t reboot(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount);
static CLI_Command_t commands[] = static CLI_Command_t commands[] =
{ {
@ -42,7 +43,8 @@ static CLI_Command_t commands[] =
{ "ist", "Zeige Istwerte an [-r für wiederholende Anzeige]", ist_werte }, { "ist", "Zeige Istwerte an [-r für wiederholende Anzeige]", ist_werte },
{ "fan", "Setze Tastverhältnis für Lüfter", set_dutyCyle }, { "fan", "Setze Tastverhältnis für Lüfter", set_dutyCyle },
{ "icall", "Starte Strom Kalibrierung", set_icall }, { "icall", "Starte Strom Kalibrierung", set_icall },
{ "ucall", "Starte Spannungs Kalibrierung", set_ucall } { "ucall", "Starte Spannungs Kalibrierung", set_ucall },
{ "reboot", "System neu starten", reboot },
}; };
static std::uint32_t i_soll = 0U; static std::uint32_t i_soll = 0U;
@ -228,6 +230,13 @@ uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t
return 0U; return 0U;
} }
uint16_t reboot(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
{
printf("\r\nReboot System...");
while(!LL_LPUART_IsActiveFlag_TC(LPUART1));
NVIC_SystemReset();
}
static bool do_icall(iADC& adc, iI2C& eeprom) static bool do_icall(iADC& adc, iI2C& eeprom)
{ {
bool done = false; bool done = false;