From 0ae620031bf73dc0213c97cbd0c5cdcb1e0ba5a0 Mon Sep 17 00:00:00 2001 From: Chris Leishman Date: Wed, 5 Nov 2025 12:35:01 +0000 Subject: [PATCH 1/3] Add missing field initializers Resolves #18 --- OneWireESP32.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/OneWireESP32.cpp b/OneWireESP32.cpp index 9f033d3..a182a74 100644 --- a/OneWireESP32.cpp +++ b/OneWireESP32.cpp @@ -39,12 +39,16 @@ static rmt_symbol_word_t ow_bit1 = { const rmt_transmit_config_t owtxconf = { .loop_count = 0, .flags = { - .eot_level = 1 + .eot_level = 1, + .queue_nonblocking = false } }; const rmt_receive_config_t owrxconf = { .signal_range_min_ns = 1000, .signal_range_max_ns = (OW_RESET_PULSE + OW_RESET_WAIT) * 1000, + .flags = { + .en_partial_rx = false + } }; @@ -73,7 +77,14 @@ OneWire32::OneWire32(uint8_t pin){ .gpio_num = owpin, .clk_src = RMT_CLK_SRC_DEFAULT, .resolution_hz = 1000000, - .mem_block_symbols = MAX_BLOCKS + .mem_block_symbols = MAX_BLOCKS, + .intr_priority = 0, + .flags = { + .invert_in = 0, + .with_dma = 0, + .io_loop_back = 0, + .allow_pd = 0 + } }; if(rmt_new_rx_channel(&rxconf, &(owrx)) != ESP_OK) { @@ -86,9 +97,13 @@ OneWire32::OneWire32(uint8_t pin){ .resolution_hz = 1000000, .mem_block_symbols = MAX_BLOCKS, .trans_queue_depth = 4, + .intr_priority = 0, .flags = { + .invert_out = 0, + .with_dma = 0, .io_loop_back = 1, - .io_od_mode = 1 + .io_od_mode = 1, + .allow_pd = 0 } }; From 9c04b3942ec244d4bc0c5bfb8e8d8d8e450bb15f Mon Sep 17 00:00:00 2001 From: Chris Leishman Date: Wed, 5 Nov 2025 13:07:26 +0000 Subject: [PATCH 2/3] Set rmt_transmit_config_t::queue_nonblocking to true --- OneWireESP32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OneWireESP32.cpp b/OneWireESP32.cpp index a182a74..4f14d3d 100644 --- a/OneWireESP32.cpp +++ b/OneWireESP32.cpp @@ -40,7 +40,7 @@ const rmt_transmit_config_t owtxconf = { .loop_count = 0, .flags = { .eot_level = 1, - .queue_nonblocking = false + .queue_nonblocking = true } }; const rmt_receive_config_t owrxconf = { From 37e58f07232358fcd2d4350cf907002a507a9b54 Mon Sep 17 00:00:00 2001 From: Chris Leishman Date: Wed, 5 Nov 2025 13:12:21 +0000 Subject: [PATCH 3/3] Wrap .allow_pd fields with check for ESP_IDF_VERSION_VAL(5, 4, 0) --- OneWireESP32.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OneWireESP32.cpp b/OneWireESP32.cpp index 4f14d3d..377ae7b 100644 --- a/OneWireESP32.cpp +++ b/OneWireESP32.cpp @@ -83,7 +83,9 @@ OneWire32::OneWire32(uint8_t pin){ .invert_in = 0, .with_dma = 0, .io_loop_back = 0, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) .allow_pd = 0 +#endif } }; @@ -103,7 +105,9 @@ OneWire32::OneWire32(uint8_t pin){ .with_dma = 0, .io_loop_back = 1, .io_od_mode = 1, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) .allow_pd = 0 +#endif } };