ist Befehl um möglichkeit zur Ausgabefrequenz erweitert. Mit Frequenz wird immer eine neue Zeile angefangen
This commit is contained in:
parent
19b2a3f088
commit
c69973ae62
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user