Reduce RXBUF size to match parser and space out log messages
This commit is contained in:
@@ -16,9 +16,6 @@ static char *tail = cmdbuf + CMD_MAX_LEN - 1;
|
||||
static char *head = cmdbuf;
|
||||
|
||||
static bool ParseLine(cmd_t *out);
|
||||
static void StartTimer(void);
|
||||
static bool IsTimedOut(void);
|
||||
static void StopTimer(void);
|
||||
|
||||
bool CMD_Parse(char ch, cmd_t *out)
|
||||
{
|
||||
@@ -30,16 +27,10 @@ bool CMD_Parse(char ch, cmd_t *out)
|
||||
// means that after a command that is too long, the
|
||||
// next command will not be parsed properly.
|
||||
|
||||
if (head == cmdbuf) {
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
if (IsTimedOut() ||
|
||||
(ch == '\n' || ch == '\r')) {
|
||||
if (ch == '\n' || ch == '\r') {
|
||||
is_valid = ParseLine(out);
|
||||
tail = cmdbuf + CMD_MAX_LEN - 1;
|
||||
head = cmdbuf;
|
||||
StopTimer();
|
||||
|
||||
return is_valid;
|
||||
}
|
||||
@@ -87,20 +78,3 @@ static bool ParseLine(cmd_t *out)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void StartTimer(void)
|
||||
{
|
||||
TCNT0 = 0x00;
|
||||
TCCR0 = BIT(CS00) | BIT(CS02);
|
||||
}
|
||||
|
||||
static bool IsTimedOut(void)
|
||||
{
|
||||
return false; // TIFR & BIT(TOV0)
|
||||
}
|
||||
|
||||
static void StopTimer(void)
|
||||
{
|
||||
TCNT0 = 0x00;
|
||||
TIFR = BIT(TOV0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user