preparation to move the command execution to another function

master
Jan Danielzick 2021-05-09 16:36:12 +02:00
parent 181aa3c9de
commit 8827530a3b
1 changed files with 7 additions and 3 deletions

View File

@ -101,8 +101,11 @@ String waitForSerialInput(uint8_t bytes){
return string; return string;
} }
void runCommand(char command, String argument){
void runCommand(){ }
void getAndRunCommand(){
uint8_t command = Serial.read(); uint8_t command = Serial.read();
int analogPin; int analogPin;
String mode; String mode;
@ -124,7 +127,8 @@ void runCommand(){
" <data>\n\r" " <data>\n\r"
" s success\n\r" " s success\n\r"
" e error\n\r" " e error\n\r"
" \\r\\n ready (this message uses \n\r to not show up as \"ready\" after the first line)\n\r" " \\n\\r data separator\n\r"
" \\r\\n ready\n\r"
"commands (input to serial line)\n\r" "commands (input to serial line)\n\r"
" R pseudo-reset\n\r" " R pseudo-reset\n\r"
" run setup again\n\r" " run setup again\n\r"
@ -285,7 +289,7 @@ void setup(){
void loop(){ void loop(){
while (true){ while (true){
if(Serial.available() > 0) { if(Serial.available() > 0) {
runCommand(); getAndRunCommand();
Serial.print("\r\n"); // send "ready" status information Serial.print("\r\n"); // send "ready" status information
} }
} }