]> granicus.if.org Git - esp-idf/commitdiff
fix rmt_set_tx_thr_intr_en(): check evt_thresh only in enable path
authordevsaurus <devsaurus@users.noreply.github.com>
Tue, 4 Apr 2017 20:06:44 +0000 (22:06 +0200)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 11 Apr 2017 10:55:56 +0000 (18:55 +0800)
components/driver/rmt.c

index c216c7475f8047ba1828bcc5334fa05b28d3fb5e..4b939f87b4a3fe02262eba945cdb5ea344053578 100644 (file)
@@ -344,8 +344,8 @@ esp_err_t rmt_set_tx_intr_en(rmt_channel_t channel, bool en)
 esp_err_t rmt_set_tx_thr_intr_en(rmt_channel_t channel, bool en, uint16_t evt_thresh)
 {
     RMT_CHECK(channel < RMT_CHANNEL_MAX, RMT_CHANNEL_ERROR_STR, ESP_ERR_INVALID_ARG);
-    RMT_CHECK(evt_thresh < 256, "RMT EVT THRESH ERR", ESP_ERR_INVALID_ARG);
     if(en) {
+        RMT_CHECK(evt_thresh < 256, "RMT EVT THRESH ERR", ESP_ERR_INVALID_ARG);
         RMT.tx_lim_ch[channel].limit = evt_thresh;
         rmt_set_tx_wrap_en(channel, true);
         rmt_set_intr_enable_mask(BIT(channel + 24));