From 5dc70bde8211cf2722828a44726a063340f933a9 Mon Sep 17 00:00:00 2001 From: Carsten Keller Date: Sun, 9 Jun 2024 17:58:17 +0200 Subject: [PATCH] reboot kommando --- Source/ElektronischeLast.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/ElektronischeLast.cpp b/Source/ElektronischeLast.cpp index 001573a..cf5eab5 100644 --- a/Source/ElektronischeLast.cpp +++ b/Source/ElektronischeLast.cpp @@ -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 set_ucall(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[] = { @@ -42,7 +43,8 @@ static CLI_Command_t commands[] = { "ist", "Zeige Istwerte an [-r für wiederholende Anzeige]", ist_werte }, { "fan", "Setze Tastverhältnis für Lüfter", set_dutyCyle }, { "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; @@ -228,6 +230,13 @@ uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t 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) { bool done = false;