Skip to content

Commit

Permalink
rmt/driver: Add module reset before enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKondrashov committed Aug 9, 2019
1 parent a418b60 commit 9a669bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/driver/rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ esp_err_t rmt_config(const rmt_config_t* rmt_param)
RMT_CHECK((!carrier_en || carrier_freq_hz > 0), "RMT carrier frequency can't be zero", ESP_ERR_INVALID_ARG);
}

static bool rmt_enable = false;
if (rmt_enable == false) {
periph_module_reset(PERIPH_RMT_MODULE);
rmt_enable = true;
}
periph_module_enable(PERIPH_RMT_MODULE);

RMT.conf_ch[channel].conf0.div_cnt = clk_div;
Expand Down

0 comments on commit 9a669bf

Please sign in to comment.