数据接收
This commit is contained in:
3
main.cpp
3
main.cpp
@@ -96,6 +96,9 @@ void uartReceive(Uart* uart){
|
|||||||
char data;
|
char data;
|
||||||
while((data=uart->receive()) != '\n'){
|
while((data=uart->receive()) != '\n'){
|
||||||
buffer[cnt++] = data;
|
buffer[cnt++] = data;
|
||||||
|
if(cnt >= 100){
|
||||||
|
LOGE("data receive over flow!");
|
||||||
|
}
|
||||||
}buffer[cnt] = 0;
|
}buffer[cnt] = 0;
|
||||||
if(cnt == 9){
|
if(cnt == 9){
|
||||||
if(buffer[8] == 'e'){
|
if(buffer[8] == 'e'){
|
||||||
|
|||||||
Reference in New Issue
Block a user