ist Kommandoi umgebaut sodass neben konttinuierlicher Ausgabe auch der Intervall angegeben werden kann. Außerdem kann man auch alles in neue Zeilen drucken.
This commit is contained in:
parent
5dc70bde82
commit
5abdc630c8
@ -8,6 +8,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cinttypes>
|
||||
#include <cmath>
|
||||
#include <stm32g0xx.h>
|
||||
@ -167,20 +168,29 @@ uint16_t set_solltrom(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16
|
||||
uint16_t ist_werte(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
|
||||
{
|
||||
static uint32_t last_call = 0U;
|
||||
uint16_t recall = 0U;
|
||||
bool recall = false;
|
||||
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;
|
||||
for(uint32_t a = 0UL; a < u16ArgCount; a++)
|
||||
{
|
||||
if(strcmp(acCommands[a], "-r") == 0)
|
||||
{
|
||||
recall = 1U;
|
||||
}
|
||||
else if(strcmp(acCommands[a], "-p") == 0)
|
||||
{
|
||||
newline = true;
|
||||
}
|
||||
else if(strcmp(acCommands[a], "-t") == 0)
|
||||
{
|
||||
recall_time = strtol(acCommands[a + 1U], NULL, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(((recall == 1U) && ((int32_t)(systick - last_call) > recall_time)) || recall == 0U)
|
||||
if((recall && ((int32_t)(systick - last_call) > recall_time)) || !recall)
|
||||
{
|
||||
char buffer[64];
|
||||
if(newline)
|
||||
|
Loading…
x
Reference in New Issue
Block a user