mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
count packets sent by RMT HW
This commit is contained in:
parent
167c5db1fe
commit
07600274f1
|
@ -197,6 +197,7 @@ int RMTChannel::RMTfillData(const byte buffer[], byte byteCount, byte repeatCoun
|
|||
void IRAM_ATTR RMTChannel::RMTinterrupt() {
|
||||
//no rmt_tx_start(channel,true) as we run in loop mode
|
||||
//preamble is always loaded at beginning of buffer
|
||||
packetCounter++;
|
||||
if (dataReady) { // if we have new data, fill while preamble is running
|
||||
rmt_fill_tx_items(channel, data, dataLen, preambleLen-1);
|
||||
dataReady = false;
|
||||
|
|
2
DCCRMT.h
2
DCCRMT.h
|
@ -41,6 +41,7 @@ class RMTChannel {
|
|||
return true;
|
||||
return dataReady;
|
||||
};
|
||||
inline uint32_t packetCount() { return packetCounter; };
|
||||
|
||||
private:
|
||||
|
||||
|
@ -54,6 +55,7 @@ class RMTChannel {
|
|||
rmt_item32_t *data;
|
||||
byte dataLen;
|
||||
byte maxDataLen;
|
||||
uint32_t packetCounter = 0;
|
||||
// flags
|
||||
volatile bool dataReady = false; // do we have real data available or send idle
|
||||
volatile byte dataRepeat = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user