Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions OneWireESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = true
}
};
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
}
};


Expand Down Expand Up @@ -73,7 +77,16 @@ 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,
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
.allow_pd = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)

#endif
}
};

if(rmt_new_rx_channel(&rxconf, &(owrx)) != ESP_OK) {
Expand All @@ -86,9 +99,15 @@ 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,
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
.allow_pd = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)

#endif
}
};

Expand Down