Handle USART_RXC interrupt
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user