Skip to content

Commit

Permalink
esp32/esp32_rmt: Fix RMT looping.
Browse files Browse the repository at this point in the history
Commit 7ea06a3 moved the
`rmt_write_items()` call to fix RMT looping for ESP32-S3, but broke it for
the other ESP32s.  This commit conditionally compiles the location of that
call.

Signed-off-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
  • Loading branch information
bulletmark authored and dpgeorge committed Nov 23, 2023
1 parent d615492 commit 094b52b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ports/esp32/esp32_rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,18 @@ STATIC mp_obj_t esp32_rmt_write_pulses(size_t n_args, const mp_obj_t *args) {
check_esp_err(rmt_wait_tx_done(self->channel_id, portMAX_DELAY));
}

#if !CONFIG_IDF_TARGET_ESP32S3
check_esp_err(rmt_write_items(self->channel_id, self->items, num_items, false));
#endif

if (self->loop_en) {
check_esp_err(rmt_set_tx_intr_en(self->channel_id, false));
check_esp_err(rmt_set_tx_loop_mode(self->channel_id, true));
}

#if CONFIG_IDF_TARGET_ESP32S3
check_esp_err(rmt_write_items(self->channel_id, self->items, num_items, false));
#endif

return mp_const_none;
}
Expand Down

0 comments on commit 094b52b

Please sign in to comment.