Confirm char over softSerial

This commit is contained in:
Matt McWilliams 2023-02-13 15:48:44 -05:00
parent 751da7728b
commit 0c01eeb36e
1 changed files with 21 additions and 9 deletions

View File

@ -122,11 +122,11 @@ void cmd (char which, int source) {
} else if (which == Bcmd && !Brunning) {
backward(source);
} else if (which == cmd_debug) {
debug();
debug(source);
} else if (which == cmd_connect) {
connect();
connect(source);
} else if (which == cmd_mcopy_identifier) {
identify();
identify(source);
}
}
@ -312,19 +312,31 @@ void btnCmd (int index, int time) {
}
}
void connect () {
void connect (int source) {
if (source == 0) {
Serial.println(cmd_connect);
} else if (source == 1) {
softSerial.write(cmd_connect);
}
log("connect()");
}
void identify () {
void identify (int source) {
if (source == 0) {
Serial.println(cmd_takeup_identifier);
} else if (source == 1) {
softSerial.write(cmd_takeup_identifier);
}
log("identify()");
}
void debug () {
void debug (int source) {
debug_state = true;
if (source == 0) {
Serial.println(cmd_debug);
} else if (source == 1) {
softSerial.write(cmd_debug);
}
log("debugging enabled");
}