1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 16:16:13 +01:00

go back to idle/reset packet if nothing to do

This commit is contained in:
Harald Barth 2022-08-02 21:44:29 +02:00
parent 37ea688eab
commit df767aaa36

View File

@ -198,12 +198,17 @@ void IRAM_ATTR RMTChannel::RMTinterrupt() {
//no rmt_tx_start(channel,true) as we run in loop mode //no rmt_tx_start(channel,true) as we run in loop mode
//preamble is always loaded at beginning of buffer //preamble is always loaded at beginning of buffer
packetCounter++; packetCounter++;
if (!dataReady && dataRepeat == 0) { // we did run empty
rmt_fill_tx_items(channel, idle, idleLen, preambleLen-1);
return; // nothing to do about that
}
// take care of incoming data
if (dataReady) { // if we have new data, fill while preamble is running if (dataReady) { // if we have new data, fill while preamble is running
rmt_fill_tx_items(channel, data, dataLen, preambleLen-1); rmt_fill_tx_items(channel, data, dataLen, preambleLen-1);
dataReady = false; dataReady = false;
} }
if (dataRepeat > 0) // if a repeat count was specified, work on that if (dataRepeat > 0) // if a repeat count was specified, work on that
dataRepeat--; dataRepeat--;
return;
} }
#endif //ESP32 #endif //ESP32