mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-04-21 12:31:19 +02:00
Compare commits
3 Commits
4125e73318
...
8ac61b88d4
Author | SHA1 | Date | |
---|---|---|---|
|
8ac61b88d4 | ||
|
8aabede3ee | ||
|
839ea582a4 |
31
DCC.cpp
31
DCC.cpp
@ -759,7 +759,15 @@ void DCC::issueReminders() {
|
|||||||
if (!DCCWaveform::mainTrack.isReminderWindowOpen()) return;
|
if (!DCCWaveform::mainTrack.isReminderWindowOpen()) return;
|
||||||
// Move to next loco slot. If occupied, send a reminder.
|
// Move to next loco slot. If occupied, send a reminder.
|
||||||
int reg = lastLocoReminder+1;
|
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) {
|
if (speedTable[reg].loco > 0) {
|
||||||
// have found loco to remind
|
// have found loco to remind
|
||||||
if (issueReminder(reg))
|
if (issueReminder(reg))
|
||||||
@ -780,40 +788,23 @@ bool DCC::issueReminder(int reg) {
|
|||||||
break;
|
break;
|
||||||
case 1: // remind function group 1 (F0-F4)
|
case 1: // remind function group 1 (F0-F4)
|
||||||
if (flags & FN_GROUP_1)
|
if (flags & FN_GROUP_1)
|
||||||
#ifndef DISABLE_FUNCTION_REMINDERS
|
|
||||||
setFunctionInternal(loco,0, 128 | ((functions>>1)& 0x0F) | ((functions & 0x01)<<4),0); // 100D DDDD
|
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;
|
break;
|
||||||
case 2: // remind function group 2 F5-F8
|
case 2: // remind function group 2 F5-F8
|
||||||
if (flags & FN_GROUP_2)
|
if (flags & FN_GROUP_2)
|
||||||
#ifndef DISABLE_FUNCTION_REMINDERS
|
|
||||||
setFunctionInternal(loco,0, 176 | ((functions>>5)& 0x0F),0); // 1011 DDDD
|
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;
|
break;
|
||||||
case 3: // remind function group 3 F9-F12
|
case 3: // remind function group 3 F9-F12
|
||||||
if (flags & FN_GROUP_3)
|
if (flags & FN_GROUP_3)
|
||||||
#ifndef DISABLE_FUNCTION_REMINDERS
|
|
||||||
setFunctionInternal(loco,0, 160 | ((functions>>9)& 0x0F),0); // 1010 DDDD
|
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;
|
break;
|
||||||
case 4: // remind function group 4 F13-F20
|
case 4: // remind function group 4 F13-F20
|
||||||
if (flags & FN_GROUP_4)
|
if (flags & FN_GROUP_4)
|
||||||
setFunctionInternal(loco,222, ((functions>>13)& 0xFF),2);
|
setFunctionInternal(loco,222, ((functions>>13)& 0xFF),0);
|
||||||
flags&= ~FN_GROUP_4; // dont send them again
|
|
||||||
break;
|
break;
|
||||||
case 5: // remind function group 5 F21-F28
|
case 5: // remind function group 5 F21-F28
|
||||||
if (flags & FN_GROUP_5)
|
if (flags & FN_GROUP_5)
|
||||||
setFunctionInternal(loco,223, ((functions>>21)& 0xFF),2);
|
setFunctionInternal(loco,223, ((functions>>21)& 0xFF),0);
|
||||||
flags&= ~FN_GROUP_5; // dont send them again
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
loopStatus++;
|
loopStatus++;
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
#define VERSION "5.4.7"
|
#define VERSION "5.4.8"
|
||||||
|
// 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
|
// 5.4.7 - Bugfix: EXRAIL fix CLEAR_ALL_STASH
|
||||||
// 5.4.6 - Bugfix: Do not drop further commands in same packet
|
// 5.4.6 - Bugfix: Do not drop further commands in same packet
|
||||||
// 5.4.5 - ESP32: Better detection of correct IDF version
|
// 5.4.5 - ESP32: Better detection of correct IDF version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user