使用命令行参数

This commit is contained in:
xinyang
2019-04-14 20:06:47 +08:00
parent 1070c5caa7
commit 34ba7df66f
3 changed files with 7 additions and 6 deletions

View File

@@ -93,9 +93,10 @@ void uartReceive(Uart* uart){
char buffer[100];
int cnt=0;
while(true){
char data;
while((data=uart->receive()) != '\n'){
buffer[cnt++] = data;
unsigned int data;
while(1){
cout << (data=uart->receive()) << endl;
// buffer[cnt++] = data;
}buffer[cnt] = 0;
if(cnt==1 && buffer[0]=='e'){
state = ENERGY_STATE;