mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 12:07:52 +00:00
fix(lp_i2s): added cbs iram check
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "esp_clk_tree.h"
|
||||
#include "esp_memory_utils.h"
|
||||
#include "hal/hal_utils.h"
|
||||
#include "hal/lp_i2s_hal.h"
|
||||
#include "hal/lp_i2s_ll.h"
|
||||
@@ -250,6 +251,13 @@ esp_err_t lp_i2s_register_event_callbacks(lp_i2s_chan_handle_t handle, const lp_
|
||||
ESP_RETURN_ON_FALSE(handle && cbs, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
|
||||
ESP_RETURN_ON_FALSE(handle->state < I2S_CHAN_STATE_RUNNING, ESP_ERR_INVALID_STATE, TAG, "the channel is in enabled state already");
|
||||
|
||||
if (cbs->on_thresh_met) {
|
||||
ESP_RETURN_ON_FALSE(esp_ptr_in_iram(cbs->on_thresh_met), ESP_ERR_INVALID_ARG, TAG, "on_thresh_met callback not in IRAM");
|
||||
}
|
||||
if (cbs->on_request_new_trans) {
|
||||
ESP_RETURN_ON_FALSE(esp_ptr_in_iram(cbs->on_request_new_trans), ESP_ERR_INVALID_ARG, TAG, "on_request_new_trans callback not in IRAM");
|
||||
}
|
||||
|
||||
handle->cbs.on_thresh_met = cbs->on_thresh_met;
|
||||
handle->cbs.on_request_new_trans = cbs->on_request_new_trans;
|
||||
handle->user_data = user_data;
|
||||
|
Reference in New Issue
Block a user