diff --git a/DCC.cpp b/DCC.cpp index 0f28991..bcece68 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -759,7 +759,15 @@ void DCC::issueReminders() { if (!DCCWaveform::mainTrack.isReminderWindowOpen()) return; // Move to next loco slot. If occupied, send a reminder. int reg = lastLocoReminder+1; - if (reg > highestUsedReg) reg = 0; // Go to start of table + if (reg > highestUsedReg) { + if (loopStatus == 0 /*only needed if numLocos == 1 but we do not have a counter*/) { + // insert idle packet in the speed packet loop to fullfill the *censored* + // >5ms between packets to same decoder rule + const byte idlepacket[] = {0xFF, 0x00, 0xFF}; + DCCWaveform::mainTrack.schedulePacket(idlepacket, 3, 0); + } + reg = 0; // Go to start of table + } if (speedTable[reg].loco > 0) { // have found loco to remind if (issueReminder(reg)) @@ -780,40 +788,23 @@ bool DCC::issueReminder(int reg) { break; case 1: // remind function group 1 (F0-F4) if (flags & FN_GROUP_1) -#ifndef DISABLE_FUNCTION_REMINDERS setFunctionInternal(loco,0, 128 | ((functions>>1)& 0x0F) | ((functions & 0x01)<<4),0); // 100D DDDD -#else - setFunctionInternal(loco,0, 128 | ((functions>>1)& 0x0F) | ((functions & 0x01)<<4),2); - flags&= ~FN_GROUP_1; // dont send them again -#endif break; case 2: // remind function group 2 F5-F8 if (flags & FN_GROUP_2) -#ifndef DISABLE_FUNCTION_REMINDERS setFunctionInternal(loco,0, 176 | ((functions>>5)& 0x0F),0); // 1011 DDDD -#else - setFunctionInternal(loco,0, 176 | ((functions>>5)& 0x0F),2); - flags&= ~FN_GROUP_2; // dont send them again -#endif break; case 3: // remind function group 3 F9-F12 if (flags & FN_GROUP_3) -#ifndef DISABLE_FUNCTION_REMINDERS setFunctionInternal(loco,0, 160 | ((functions>>9)& 0x0F),0); // 1010 DDDD -#else - setFunctionInternal(loco,0, 160 | ((functions>>9)& 0x0F),2); - flags&= ~FN_GROUP_3; // dont send them again -#endif break; case 4: // remind function group 4 F13-F20 if (flags & FN_GROUP_4) - setFunctionInternal(loco,222, ((functions>>13)& 0xFF),2); - flags&= ~FN_GROUP_4; // dont send them again + setFunctionInternal(loco,222, ((functions>>13)& 0xFF),0); break; case 5: // remind function group 5 F21-F28 if (flags & FN_GROUP_5) - setFunctionInternal(loco,223, ((functions>>21)& 0xFF),2); - flags&= ~FN_GROUP_5; // dont send them again + setFunctionInternal(loco,223, ((functions>>21)& 0xFF),0); break; } loopStatus++; diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 6b6db29..4db69df 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -217,7 +217,7 @@ #define BROADCAST(msg) #define CALL(route) #define CLEAR_STASH(id) -#define CLEAR_ALL_STASH(id) +#define CLEAR_ALL_STASH #define CLOSE(id) #define CONFIGURE_SERVO(vpin,pos1,pos2,profile) #define DCC_SIGNAL(id,add,subaddr) diff --git a/version.h b/version.h index 070085b..799521e 100644 --- a/version.h +++ b/version.h @@ -5,6 +5,9 @@ #define VERSION "5.4.99" // 5.4.99 - Special version number for experiments +// 5.4.8 - Bugfix: Insert idle packet at end of speed reminder loop; treat all function groups equal +// 5.4.7 - Bugfix: EXRAIL fix CLEAR_ALL_STASH +>>>>>>> master // 5.4.6 - Bugfix: Do not drop further commands in same packet // 5.4.5 - ESP32: Better detection of correct IDF version // - track power is always turned on after setJoin() not by setJoin()