diff --git a/Source/ElektronischeLast.cpp b/Source/ElektronischeLast.cpp index a17ee80..c5aee9c 100644 --- a/Source/ElektronischeLast.cpp +++ b/Source/ElektronischeLast.cpp @@ -114,14 +114,25 @@ uint16_t ist_werte(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t { static uint32_t last_call = 0U; uint16_t recall = 0U; - if(u16ArgCount == 1U) + int32_t recall_time = 999; + bool newline = false; + if(u16ArgCount >= 1U) { recall = (acCommands[0][0] == '-' && acCommands[0][1] == 'r' && acCommands[0][2] == '\0'); } + if(u16ArgCount >= 2U) + { + recall_time = strtol(acCommands[1], NULL, 10); + newline = true; + } - if(((recall == 1U) && ((int32_t)(systick - last_call) > 999)) || recall == 0U) + if(((recall == 1U) && ((int32_t)(systick - last_call) > recall_time)) || recall == 0U) { char buffer[64]; + if(newline) + { + pfvOutFunction("\n"); + } snprintf(buffer, sizeof(buffer), "\rI: %5" PRIu32 " U: %5" PRIu32 " T: %5" PRIu32 " V: %5" PRIu32, strom, spannung, temperatur, geschwindigkeit); pfvOutFunction(buffer);