Fix code repetition

This commit is contained in:
2024-08-27 18:06:39 +02:00
parent 337648e98b
commit 1ecdba78f8
2 changed files with 4 additions and 8 deletions

View File

@@ -11,14 +11,10 @@ int main(void)
for (i = 1;; i++) {
if (i >= 99999) i = 1;
if (USART_IsDataAvailable()) {
while ((ch = USART_GetChar())) {
CMD_Parse(ch);
}
}
USART_Printf("[CORE] Fetching sensors #%05lu...\r\n", i);
while ((ch = USART_GetChar())) {
CMD_Parse(ch);
}
Sleep(3000);
}

View File

@@ -34,7 +34,7 @@ char USART_GetChar(void)
{
unsigned char newtail;
if (rxhead == rxtail) {
if (!USART_IsDataAvailable()) {
return '\0'; // Non-blocking
}