From 0c01eeb36eac71326dde33dc08ba78c8ee0eb9b6 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Mon, 13 Feb 2023 15:48:44 -0500 Subject: [PATCH] Confirm char over softSerial --- ino/takeup/takeup.ino | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ino/takeup/takeup.ino b/ino/takeup/takeup.ino index 48e7320..4e5c267 100644 --- a/ino/takeup/takeup.ino +++ b/ino/takeup/takeup.ino @@ -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 () { - Serial.println(cmd_connect); +void connect (int source) { + if (source == 0) { + Serial.println(cmd_connect); + } else if (source == 1) { + softSerial.write(cmd_connect); + } log("connect()"); } -void identify () { - Serial.println(cmd_takeup_identifier); +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; - Serial.println(cmd_debug); + if (source == 0) { + Serial.println(cmd_debug); + } else if (source == 1) { + softSerial.write(cmd_debug); + } log("debugging enabled"); }