Merge branch 'bugfix/legacy_rmt_resource_leak' into 'master'

rmt: fix memory leak in the legacy driver

Closes IDFGH-8732 and IDF-5941

See merge request espressif/esp-idf!21084
This commit is contained in:
morris
2022-11-20 16:55:39 +08:00
3 changed files with 7 additions and 10 deletions

View File

@@ -212,11 +212,14 @@ TEST_CASE("RMT multiple channels", "[rmt]")
TEST_CASE("RMT install/uninstall test", "[rmt]")
{
rmt_config_t tx_cfg = RMT_DEFAULT_CONFIG_TX(RMT_DATA_IO, RMT_TX_CHANNEL_ENCODING_END);
// uninstall function is allowed to be called at any time
TEST_ESP_OK(rmt_driver_uninstall(tx_cfg.channel));
TEST_ESP_OK(rmt_config(&tx_cfg));
for (int i = 0; i < 100; i++) {
TEST_ESP_OK(rmt_driver_install(tx_cfg.channel, 1000, 0));
TEST_ESP_OK(rmt_driver_uninstall(tx_cfg.channel));
}
TEST_ESP_OK(rmt_driver_uninstall(tx_cfg.channel));
rmt_config_t rx_cfg = RMT_DEFAULT_CONFIG_RX(RMT_DATA_IO, RMT_RX_CHANNEL_ENCODING_START);
TEST_ESP_OK(rmt_config(&rx_cfg));
for (int i = 0; i < 100; i++) {