]> granicus.if.org Git - esp-idf/commitdiff
Modify the rmt_mem_num maximum limit value from 15 to 8.
authorXiongYu <xiongyu@espressif.com>
Mon, 9 Jul 2018 11:22:31 +0000 (19:22 +0800)
committerXiongYu <xiongyu@espressif.com>
Mon, 16 Jul 2018 11:10:42 +0000 (19:10 +0800)
components/driver/rmt.c

index 9460cefa714a3077bc7a5f17ad1390cae7f7f3b4..8ee1640c0bf60daecf9f4bb5b459189e7314c5e1 100644 (file)
@@ -137,7 +137,7 @@ esp_err_t rmt_get_rx_idle_thresh(rmt_channel_t channel, uint16_t *thresh)
 esp_err_t rmt_set_mem_block_num(rmt_channel_t channel, uint8_t rmt_mem_num)
 {
     RMT_CHECK(channel < RMT_CHANNEL_MAX, RMT_CHANNEL_ERROR_STR, ESP_ERR_INVALID_ARG);
-    RMT_CHECK(rmt_mem_num < 16, RMT_MEM_CNT_ERROR_STR, ESP_ERR_INVALID_ARG);
+    RMT_CHECK(rmt_mem_num <= RMT_CHANNEL_MAX - channel, RMT_MEM_CNT_ERROR_STR, ESP_ERR_INVALID_ARG);
     RMT.conf_ch[channel].conf0.mem_size = rmt_mem_num;
     return ESP_OK;
 }
@@ -669,7 +669,7 @@ esp_err_t rmt_driver_uninstall(rmt_channel_t channel)
     }
     //Avoid blocking here(when the interrupt is disabled and do not wait tx done).
     if(p_rmt_obj[channel]->wait_done) {
-        xSemaphoreTake(p_rmt_obj[channel]->tx_sem, portMAX_DELAY);  
+        xSemaphoreTake(p_rmt_obj[channel]->tx_sem, portMAX_DELAY);
     }
     rmt_set_rx_intr_en(channel, 0);
     rmt_set_err_intr_en(channel, 0);
@@ -929,4 +929,4 @@ esp_err_t rmt_write_sample(rmt_channel_t channel, const uint8_t *src, size_t src
         xSemaphoreGive(p_rmt->tx_sem);
     }
     return ESP_OK;
-}
\ No newline at end of file
+}