1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +01:00

do compare with 255 right

This commit is contained in:
Harald Barth 2022-08-02 20:58:05 +02:00
parent 89905f8ed7
commit 37ea688eab

View File

@ -63,9 +63,9 @@ class DCCWaveform {
uint32_t packetcount = isMainTrack ? uint32_t packetcount = isMainTrack ?
rmtMainChannel->packetCount() : rmtProgChannel->packetCount(); rmtMainChannel->packetCount() : rmtProgChannel->packetCount();
uint32_t count = packetcount - resetPacketBase; uint32_t count = packetcount - resetPacketBase;
if ((count & 255) == 0) // no high bits set if (count > 255) // cap to 255
return count;
return 255; return 255;
return count;
}; };
#endif #endif
void schedulePacket(const byte buffer[], byte byteCount, byte repeats); void schedulePacket(const byte buffer[], byte byteCount, byte repeats);