Skip to content

Commit

Permalink
Merge branch 'devel' into devel-websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbelos committed Jan 18, 2025
2 parents 5941866 + 137008c commit 5600382
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions DCCRMT.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class RMTChannel {
return true;
return dataReady;
};
inline void waitForDataCopy() {
while(1) { // do nothing and wait for interrupt clearing dataReady to happen
if (dataReady == false)
break;
}
};
inline uint32_t packetCount() { return packetCounter; };

private:
Expand Down
12 changes: 5 additions & 7 deletions DCCWaveformRMT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ void DCCWaveform::begin() {

void DCCWaveform::schedulePacket(const byte buffer[], byte byteCount, byte repeats) {
if (byteCount > MAX_PACKET_SIZE) return; // allow for chksum
RMTChannel *rmtchannel = (isMainTrack ? rmtMainChannel : rmtProgChannel);
if (rmtchannel == NULL)
return; // no idea to prepare packet if we can not send it anyway

rmtchannel->waitForDataCopy(); // blocking wait so we can write into buffer
byte checksum = 0;
for (byte b = 0; b < byteCount; b++) {
checksum ^= buffer[b];
Expand All @@ -88,13 +92,7 @@ void DCCWaveform::schedulePacket(const byte buffer[], byte byteCount, byte repea
{
int ret = 0;
do {
if(isMainTrack) {
if (rmtMainChannel != NULL)
ret = rmtMainChannel->RMTfillData(pendingPacket, pendingLength, pendingRepeats);
} else {
if (rmtProgChannel != NULL)
ret = rmtProgChannel->RMTfillData(pendingPacket, pendingLength, pendingRepeats);
}
ret = rmtchannel->RMTfillData(pendingPacket, pendingLength, pendingRepeats);
} while(ret > 0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion GITHUB_SHA.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define GITHUB_SHA "devel-202501092043Z"
#define GITHUB_SHA "devel-202501171827Z"
3 changes: 2 additions & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

#include "StringFormatter.h"

#define VERSION "5.5.6"
#define VERSION "5.5.7"
// 5.5.7 - ESP32 bugfix packet buffer race (as 5.4.1)
// 5.5.6 - Fix ESP32 build bug caused by include reference loop
// 5.5.5 - Railcom implementation with IO_I2CRailcom driver
// - response analysis and block management.
Expand Down

0 comments on commit 5600382

Please sign in to comment.