From 6127a5af865696f7be91df93be17725cbbb41775 Mon Sep 17 00:00:00 2001 From: Robert van den Breemen Date: Thu, 26 Jan 2023 15:27:25 +0100 Subject: [PATCH] fix for pic detections (thanks to @HVXL) --- OTGW-Core.ino | 6 +----- handleDebug.ino | 10 +--------- version.h | 14 +++++++------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/OTGW-Core.ino b/OTGW-Core.ino index 8dad167..9b6d053 100644 --- a/OTGW-Core.ino +++ b/OTGW-Core.ino @@ -126,9 +126,7 @@ detectPIC() void detectPIC(){ OTGWSerial.registerFirmwareCallback(fwreportinfo); //register the callback to report version, type en device ID OTGWSerial.resetPic(); // make sure it the firmware is detected - uint8_t ch; - OTGWSerial.readBytes(&ch, 1); //Wait for ETX or not - bPICavailable = (ch == ETX); + bPICavailable = OTGWSerial.find(ETX); if (bPICavailable) { DebugTln("ETX found after reset: Pic detected!"); } else { @@ -1553,8 +1551,6 @@ void processOT(const char *buf, int len){ //OTGWDebugf("[%-30s]", messageIDToString(static_cast(OTdata.id))); //OTGWDebugf("[M=%d]",OTdata.master); - - if (OTdata.skipthis){ if ((OTdata.rsptype == OTGW_PARITY_ERROR)) { AddLog("P"); //skipped due to parity error diff --git a/handleDebug.ino b/handleDebug.ino index 4204201..19bc594 100644 --- a/handleDebug.ino +++ b/handleDebug.ino @@ -20,15 +20,7 @@ void handleDebug(){ break; case 'p': DebugTln(F("Manual reset PIC")); - resetOTGW(); - uint8_t ch; - OTGWSerial.readBytes(&ch, 1); //Wait for ETX or not - if (ch == ETX) { - DebugTln("ETX found after reset: Pic detected!"); - } else { - DebugTln("No ETX found after reset: no Pic detected!"); - } - + detectPIC(); break; case 'a': DebugTln(F("Send PR=A command, to ID the chip")); diff --git a/version.h b/version.h index 4525853..2915aac 100644 --- a/version.h +++ b/version.h @@ -2,15 +2,15 @@ #define _VERSION_MAJOR 0 #define _VERSION_MINOR 10 #define _VERSION_PATCH 0 -#define _VERSION_BUILD 1974 -#define _VERSION_GITHASH "0d0cc15" +#define _VERSION_BUILD 1975 +#define _VERSION_GITHASH "11a00e3" #define _VERSION_PRERELEASE beta #define _VERSION_DATE "26-01-2023" -#define _VERSION_TIME "06:52:13" +#define _VERSION_TIME "15:24:48" #define _SEMVER_CORE "0.10.0" -#define _SEMVER_BUILD "0.10.0+1974" -#define _SEMVER_GITHASH "0.10.0+0d0cc15" -#define _SEMVER_FULL "0.10.0-beta+0d0cc15" +#define _SEMVER_BUILD "0.10.0+1975" +#define _SEMVER_GITHASH "0.10.0+11a00e3" +#define _SEMVER_FULL "0.10.0-beta+11a00e3" #define _SEMVER_NOBUILD "0.10.0-beta (26-01-2023)" -#define _VERSION "0.10.0-beta+0d0cc15 (26-01-2023)" +#define _VERSION "0.10.0-beta+11a00e3 (26-01-2023)" //The version information is created automatically, more information here: https://github.com/rvdbreemen/autoinc-semver