diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 8150235..77a75c5 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308012308Z" +#define GITHUB_SHA "devel-202308020800Z" diff --git a/MotorDriver.h b/MotorDriver.h index b8de0b0..21bceb6 100644 --- a/MotorDriver.h +++ b/MotorDriver.h @@ -28,7 +28,7 @@ #include "DCCTimer.h" // use powers of two so we can do logical and/or on the track modes in if clauses. -enum TRACK_MODE : byte {TRACK_MODE_OFF = 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}; #define setHIGH(fastpin) *fastpin.inout |= fastpin.maskHIGH @@ -290,7 +290,7 @@ class MotorDriver { static const int TRIP_CURRENT_PROG=250; unsigned long power_sample_overload_wait = POWER_SAMPLE_OVERLOAD_WAIT; unsigned int power_good_counter = 0; - TRACK_MODE trackMode = TRACK_MODE_OFF; // we assume off at startup + TRACK_MODE trackMode = TRACK_MODE_NONE; // we assume track not assigned at startup }; #endif diff --git a/TrackManager.cpp b/TrackManager.cpp index b786181..db5b6b9 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -38,6 +38,7 @@ const int16_t HASH_KEYWORD_PROG = -29718; #endif const int16_t HASH_KEYWORD_MAIN = 11339; const int16_t HASH_KEYWORD_OFF = 22479; +const int16_t HASH_KEYWORD_NONE = -26550; const int16_t HASH_KEYWORD_DC = 2183; const int16_t HASH_KEYWORD_DCX = 6463; // DC reversed polarity const int16_t HASH_KEYWORD_EXT = 8201; // External DCC signal @@ -140,7 +141,7 @@ void TrackManager::addTrack(byte t, MotorDriver* driver) { track[t]=driver; if (driver) { track[t]->setPower(POWERMODE::OFF); - track[t]->setMode(TRACK_MODE_OFF); + track[t]->setMode(TRACK_MODE_NONE); track[t]->setTrackLetter('A'+t); lastTrack=t; } @@ -224,7 +225,7 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr FOR_EACH_TRACK(t) if (track[t]->getMode()==TRACK_MODE_PROG && t != trackToSet) { track[t]->setPower(POWERMODE::OFF); - track[t]->setMode(TRACK_MODE_OFF); + track[t]->setMode(TRACK_MODE_NONE); track[t]->makeProgTrack(false); // revoke prog track special handling streamTrackState(NULL,t); } @@ -332,8 +333,8 @@ bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[]) return setTrackMode(p[0],TRACK_MODE_PROG); #endif - if (params==2 && p[1]==HASH_KEYWORD_OFF) // <= id OFF> - return setTrackMode(p[0],TRACK_MODE_OFF); + if (params==2 && (p[1]==HASH_KEYWORD_OFF || p[1]==HASH_KEYWORD_NONE)) // <= id OFF> <= id NONE> + return setTrackMode(p[0],TRACK_MODE_NONE); if (params==2 && p[1]==HASH_KEYWORD_EXT) // <= id EXT> return setTrackMode(p[0],TRACK_MODE_EXT); @@ -360,8 +361,8 @@ void TrackManager::streamTrackState(Print* stream, byte t) { format=F("<= %c PROG>\n"); break; #endif - case TRACK_MODE_OFF: - format=F("<= %c OFF>\n"); + case TRACK_MODE_NONE: + format=F("<= %c NONE>\n"); break; case TRACK_MODE_EXT: format=F("<= %c EXT>\n"); @@ -443,7 +444,7 @@ void TrackManager::setPower2(bool setProg,POWERMODE mode) { driver->setBrake(false); driver->setPower(mode); break; - case TRACK_MODE_OFF: + case TRACK_MODE_NONE: break; } } diff --git a/version.h b/version.h index 9323606..465f684 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.67" +#define VERSION "4.2.68" +// 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting // - Protect Uno user from choosing DC(X) // - More Nucleo variant defines