From f94a5f971ef47338f648439925a432130a3a6a90 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 7 Mar 2023 16:20:00 +0100 Subject: [PATCH] Bugfix signalpin2 was not set up in shadow port --- GITHUB_SHA.h | 2 +- MotorDriver.cpp | 17 +++++++++++++++++ version.h | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 75a9be6..54a7905 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202302281422Z" +#define GITHUB_SHA "devel-202303071416Z" diff --git a/MotorDriver.cpp b/MotorDriver.cpp index a6a1766..0236215 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -75,6 +75,23 @@ MotorDriver::MotorDriver(int16_t power_pin, byte signal_pin, byte signal_pin2, i dualSignal=true; getFastPin(F("SIG2"),signalPin2,fastSignalPin2); pinMode(signalPin2, OUTPUT); + + fastSignalPin2.shadowinout = NULL; + if (HAVE_PORTA(fastSignalPin2.inout == &PORTA)) { + DIAG(F("Found PORTA pin %d"),signalPin2); + fastSignalPin2.shadowinout = fastSignalPin2.inout; + fastSignalPin2.inout = &shadowPORTA; + } + if (HAVE_PORTB(fastSignalPin2.inout == &PORTB)) { + DIAG(F("Found PORTB pin %d"),signalPin2); + fastSignalPin2.shadowinout = fastSignalPin2.inout; + fastSignalPin2.inout = &shadowPORTB; + } + if (HAVE_PORTC(fastSignalPin2.inout == &PORTC)) { + DIAG(F("Found PORTC pin %d"),signalPin2); + fastSignalPin2.shadowinout = fastSignalPin2.inout; + fastSignalPin2.inout = &shadowPORTC; + } } else dualSignal=false; diff --git a/version.h b/version.h index 789ef2c..a4520fb 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.22" +#define VERSION "4.2.23" +// 4.2.23 - Bugfix signalpin2 was not set up in shadow port // 4.2.22 - Implement broadcast of Track Manager changes // 4.2.21 - Implement non-blocking I2C for EX-IOExpander device driver // 4.2.20 - & commands for multi-track gauges