mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
change to RMT loop mode
This commit is contained in:
parent
114686d124
commit
a69b7ee113
@ -100,6 +100,7 @@ RMTPin::RMTPin(byte pin, byte ch, byte plen) {
|
||||
|
||||
DIAG(F("Register interrupt on core %d"), xPortGetCoreID());
|
||||
|
||||
ESP_ERROR_CHECK(rmt_set_tx_loop_mode(channel, true));
|
||||
rmt_register_tx_end_callback(interrupt, this);
|
||||
rmt_set_tx_intr_en(channel, true);
|
||||
|
||||
@ -148,7 +149,8 @@ bool RMTPin::RMTfillData(const byte buffer[], byte byteCount, byte repeatCount=1
|
||||
}
|
||||
|
||||
void IRAM_ATTR RMTPin::RMTinterrupt() {
|
||||
rmt_tx_start(channel,true); // preamble is always loaded, stat right away
|
||||
//no rmt_tx_start(channel,true) as we run in loop mode
|
||||
//preamble is always loaded at beginning of buffer
|
||||
if (dataReady) { // if we have new data, fill while preamble is running
|
||||
rmt_fill_tx_items(channel, data, dataLen, preambleLen-1);
|
||||
dataReady = false;
|
||||
|
Loading…
Reference in New Issue
Block a user