Test USART reading
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -1,5 +1,5 @@
|
||||
#include "common.h"
|
||||
#include "uart.h"
|
||||
#include "serial.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -17,17 +17,17 @@ int main(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
UART_Init();
|
||||
USART_Init();
|
||||
|
||||
for (i = 1;; i++) {
|
||||
if (i >= 99999) i = 1;
|
||||
|
||||
sprintf(buf, "[CORE] Fetching sensors #%05lu...\r\n", i);
|
||||
UART_Write(buf);
|
||||
USART_Write(buf);
|
||||
|
||||
UART_Read(&cmd, MAX_CMDBUF);
|
||||
sprintf(buf, "[CORE] Checking cmdbuf=\"%s\"\r\n", cmd);
|
||||
UART_Write(buf);
|
||||
// USART_Read(&cmd, MAX_CMDBUF);
|
||||
// sprintf(buf, "[CORE] Checking cmdbuf=\"%s\"\r\n", cmd);
|
||||
// USART_Write(buf);
|
||||
|
||||
Sleep(3000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user