1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 16:46:13 +01:00

keeping up to date

This commit is contained in:
travis-farmer 2023-10-19 17:04:00 -04:00
parent 5b4a1dd6fa
commit 94273b6e11
2 changed files with 7 additions and 4 deletions

View File

@ -57,7 +57,9 @@ MotorDriver::MotorDriver(int16_t power_pin, byte signal_pin, byte signal_pin2, i
getFastPin(F("SIG"),signalPin,fastSignalPin); getFastPin(F("SIG"),signalPin,fastSignalPin);
pinMode(signalPin, OUTPUT); pinMode(signalPin, OUTPUT);
#ifndef ARDUINO_ARCH_MBED_GIGA
fastSignalPin.shadowinout = NULL; fastSignalPin.shadowinout = NULL;
#endif
if (HAVE_PORTA(fastSignalPin.inout == &PORTA)) { if (HAVE_PORTA(fastSignalPin.inout == &PORTA)) {
DIAG(F("Found PORTA pin %d"),signalPin); DIAG(F("Found PORTA pin %d"),signalPin);
fastSignalPin.shadowinout = fastSignalPin.inout; fastSignalPin.shadowinout = fastSignalPin.inout;
@ -95,7 +97,9 @@ MotorDriver::MotorDriver(int16_t power_pin, byte signal_pin, byte signal_pin2, i
getFastPin(F("SIG2"),signalPin2,fastSignalPin2); getFastPin(F("SIG2"),signalPin2,fastSignalPin2);
pinMode(signalPin2, OUTPUT); pinMode(signalPin2, OUTPUT);
#ifndef ARDUINO_ARCH_MBED_ARDUINO
fastSignalPin2.shadowinout = NULL; fastSignalPin2.shadowinout = NULL;
#endif
if (HAVE_PORTA(fastSignalPin2.inout == &PORTA)) { if (HAVE_PORTA(fastSignalPin2.inout == &PORTA)) {
DIAG(F("Found PORTA pin %d"),signalPin2); DIAG(F("Found PORTA pin %d"),signalPin2);
fastSignalPin2.shadowinout = fastSignalPin2.inout; fastSignalPin2.shadowinout = fastSignalPin2.inout;

View File

@ -30,10 +30,9 @@
// use powers of two so we can do logical and/or on the track modes in if clauses. // use powers of two so we can do logical and/or on the track modes in if clauses.
enum TRACK_MODE : byte {TRACK_MODE_NONE = 1, TRACK_MODE_MAIN = 2, TRACK_MODE_PROG = 4, enum TRACK_MODE : byte {TRACK_MODE_NONE = 1, TRACK_MODE_MAIN = 2, TRACK_MODE_PROG = 4,
TRACK_MODE_DC = 8, TRACK_MODE_DCX = 16, TRACK_MODE_EXT = 32}; TRACK_MODE_DC = 8, TRACK_MODE_DCX = 16, TRACK_MODE_EXT = 32};
#if defined(ARDUINO_GIGA) #ifdef ARDUINO_ARCH_MBED_GIGA
#define setHIGH(fastpin) (gpio_read(&fastpin)==1)
#define setHIGH(fastpin) gpio_write(&fastpin, 1) #define setLOW(fastpin) (gpio_read(&fastpin)==0)
#define setLOW(fastpin) gpio_write(&fastpin, 0)
#else #else
#define setHIGH(fastpin) *fastpin.inout |= fastpin.maskHIGH #define setHIGH(fastpin) *fastpin.inout |= fastpin.maskHIGH
#define setLOW(fastpin) *fastpin.inout &= fastpin.maskLOW #define setLOW(fastpin) *fastpin.inout &= fastpin.maskLOW