From abf538270c265f530758c7726d7d047b8a911bc9 Mon Sep 17 00:00:00 2001 From: xinyang Date: Sun, 14 Apr 2019 22:39:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.cpp b/main.cpp index 29de3b5..e505a48 100644 --- a/main.cpp +++ b/main.cpp @@ -96,6 +96,9 @@ void uartReceive(Uart* uart){ char data; while((data=uart->receive()) != '\n'){ buffer[cnt++] = data; + if(cnt >= 100){ + LOGE("data receive over flow!"); + } }buffer[cnt] = 0; if(cnt == 9){ if(buffer[8] == 'e'){