From 10209ed6f353762a54fb29e3c82f0ec58d8f1241 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 14 Nov 2021 15:35:26 +0100 Subject: [PATCH] remove uneccessary workaround, compensate for interrupt length --- DCCRMT.cpp | 27 +++++++++++++++++++-------- GITHUB_SHA.h | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/DCCRMT.cpp b/DCCRMT.cpp index abe1cf8..4a5ec59 100644 --- a/DCCRMT.cpp +++ b/DCCRMT.cpp @@ -20,8 +20,9 @@ #include "defines.h" #include "DIAG.h" #include "DCCRMT.h" -#include "soc/periph_defs.h" -#include "driver/periph_ctrl.h" + +//#include "soc/periph_defs.h" +//#include "driver/periph_ctrl.h" #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4,2,0) #error wrong IDF version @@ -41,6 +42,13 @@ void setDCCBit0(rmt_item32_t* item) { item->duration1 = DCC_0_HALFPERIOD; } +void setDCCBit0Last(rmt_item32_t* item) { + item->level0 = 1; + item->duration0 = DCC_0_HALFPERIOD + DCC_0_HALFPERIOD/10; + item->level1 = 0; + item->duration1 = DCC_0_HALFPERIOD; +} + void setEOT(rmt_item32_t* item) { item->val = 0; } @@ -56,9 +64,9 @@ RMTPin::RMTPin(byte pin, byte ch, byte plen) { preambleLen = plen+2; // plen 1 bits, one 0 bit and one EOF marker preamble = (rmt_item32_t*)malloc(preambleLen*sizeof(rmt_item32_t)); for (byte n=0; n