From 8cbc60edbc35bb3385753175596403ecb5286796 Mon Sep 17 00:00:00 2001 From: HanCheol Cho Date: Tue, 22 Jan 2019 01:29:32 -0800 Subject: [PATCH] fixed rmt receive data pointer position. (#2353) --- cores/esp32/esp32-hal-rmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cores/esp32/esp32-hal-rmt.c b/cores/esp32/esp32-hal-rmt.c index 0596f60dfc4..e3cb432cdb7 100644 --- a/cores/esp32/esp32-hal-rmt.c +++ b/cores/esp32/esp32-hal-rmt.c @@ -637,13 +637,13 @@ static void IRAM_ATTR _rmt_isr(void* arg) data += MAX_DATA_PER_CHANNEL*(g_rmt_objects[ch].buffers); } } + uint32_t *data_received = data; for (i = 0; i < g_rmt_objects[ch].data_size; i++ ) { *data++ = RMTMEM.chan[ch].data32[i].val; } if (g_rmt_objects[ch].cb) { - // actually received data ptr - uint32_t * data = g_rmt_objects[ch].data_ptr; - (g_rmt_objects[ch].cb)(data, _rmt_get_mem_len(ch)); + // actually received data ptr + (g_rmt_objects[ch].cb)(data_received, _rmt_get_mem_len(ch)); // restart the reception RMT.conf_ch[ch].conf1.mem_owner = 1;