Handle USART_RXC interrupt

This commit is contained in:
2024-08-27 01:33:39 +02:00
parent 0f5a383f14
commit 382b4770b0
3 changed files with 35 additions and 42 deletions

View File

@@ -2,6 +2,7 @@
#include "serial.h"
#include <stdio.h>
#include <avr/interrupt.h>
#define MAX_CMDBUF 256
@@ -17,6 +18,10 @@ int main(void)
return 1;
}
// Handle USART_RXC interrupt
UCSRB |= (1 << RXCIE);
sei();
USART_Init();
for (i = 1;; i++) {
@@ -24,6 +29,7 @@ int main(void)
sprintf(buf, "[CORE] Fetching sensors #%05lu...\r\n", i);
USART_Write(buf);
USART_Update();
// USART_Read(&cmd, MAX_CMDBUF);
// sprintf(buf, "[CORE] Checking cmdbuf=\"%s\"\r\n", cmd);