Browse Source

make sure to clean up resources

ugv_io
Alex Mikhalev 6 years ago
parent
commit
abdfde2762
  1. 5
      components/sx127x_driver/sx127x_driver.c

5
components/sx127x_driver/sx127x_driver.c

@ -137,6 +137,8 @@ esp_err_t sx127x_free(sx127x_t *hndl) {
ret = spi_bus_free(hndl->config.spi_host); ret = spi_bus_free(hndl->config.spi_host);
SX127X_ERROR_CHECK2(ret, spi_bus_free) SX127X_ERROR_CHECK2(ret, spi_bus_free)
vSemaphoreDelete(hndl->spi_mutex);
free(hndl); free(hndl);
return ESP_OK; return ESP_OK;
@ -368,6 +370,9 @@ esp_err_t sx127x_stop(sx127x_t *hndl) {
} }
hndl->task_handle = NULL; hndl->task_handle = NULL;
vQueueDelete(hndl->rx_packet_queue);
vQueueDelete(hndl->tx_packet_queue);
return ESP_OK; return ESP_OK;
} }

Loading…
Cancel
Save