Skip to content

Commit

Permalink
esp32/esp32_rmt: Fix looping behaviour for RMT on ESP32-S3.
Browse files Browse the repository at this point in the history
The previous code worked on ESP32 but not ESP32-S3.  All the IDF (v4.4.3)
examples call rmt_set_tx_loop_mode before rmt_write_items, so make that
change here.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
IcedRooibos authored and dpgeorge committed Apr 26, 2023
1 parent 67fb0be commit 7ea06a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/esp32/esp32_rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ 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));
}

check_esp_err(rmt_write_items(self->channel_id, self->items, num_items, false));

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));
}

check_esp_err(rmt_write_items(self->channel_id, self->items, num_items, false));

return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp32_rmt_write_pulses_obj, 2, 3, esp32_rmt_write_pulses);
Expand Down

0 comments on commit 7ea06a3

Please sign in to comment.