mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
provide methods to access sentResetsSincePacket
This commit is contained in:
parent
07600274f1
commit
6b2cd226e2
|
@ -53,6 +53,21 @@ class DCCWaveform {
|
||||||
static DCCWaveform mainTrack;
|
static DCCWaveform mainTrack;
|
||||||
static DCCWaveform progTrack;
|
static DCCWaveform progTrack;
|
||||||
inline void clearRepeats() { transmitRepeats=0; }
|
inline void clearRepeats() { transmitRepeats=0; }
|
||||||
|
#ifndef ARDUINO_ARCH_ESP32
|
||||||
|
inline void clearResets() { sentResetsSincePacket=0; }
|
||||||
|
inline byte getResets() { return sentResetsSincePacket; }
|
||||||
|
#else
|
||||||
|
inline void clearResets() { resetPacketBase = isMainTrack ?
|
||||||
|
rmtMainChannel->packetCount() : rmtProgChannel->packetCount(); };
|
||||||
|
inline byte getResets() {
|
||||||
|
uint32_t packetcount = isMainTrack ?
|
||||||
|
rmtMainChannel->packetCount() : rmtProgChannel->packetCount();
|
||||||
|
uint32_t count = packetcount - resetPacketBase;
|
||||||
|
if ((count & 255) == 0) // no high bits set
|
||||||
|
return count;
|
||||||
|
return 255;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
void schedulePacket(const byte buffer[], byte byteCount, byte repeats);
|
void schedulePacket(const byte buffer[], byte byteCount, byte repeats);
|
||||||
volatile byte sentResetsSincePacket;
|
volatile byte sentResetsSincePacket;
|
||||||
bool getPacketPending();
|
bool getPacketPending();
|
||||||
|
@ -60,6 +75,8 @@ class DCCWaveform {
|
||||||
private:
|
private:
|
||||||
#ifndef ARDUINO_ARCH_ESP32
|
#ifndef ARDUINO_ARCH_ESP32
|
||||||
volatile bool packetPending;
|
volatile bool packetPending;
|
||||||
|
#else
|
||||||
|
volatile uint32_t resetPacketBase;
|
||||||
#endif
|
#endif
|
||||||
static void interruptHandler();
|
static void interruptHandler();
|
||||||
void interrupt2();
|
void interrupt2();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user