mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
intr_alloc: fix the issue intr_enable/disable cannot be used in ISR in
esp32s2beta. This issue is reported in config freertos_compliance_s2.
This commit is contained in:
parent
262ba6f825
commit
3d1ec3f451
@ -858,7 +858,7 @@ esp_err_t IRAM_ATTR esp_intr_disable(intr_handle_t handle)
|
|||||||
} else {
|
} else {
|
||||||
//Disable using per-cpu regs
|
//Disable using per-cpu regs
|
||||||
if (handle->vector_desc->cpu!=xPortGetCoreID()) {
|
if (handle->vector_desc->cpu!=xPortGetCoreID()) {
|
||||||
portEXIT_CRITICAL(&spinlock);
|
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||||
return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
||||||
}
|
}
|
||||||
ESP_INTR_DISABLE(handle->vector_desc->intno);
|
ESP_INTR_DISABLE(handle->vector_desc->intno);
|
||||||
|
@ -780,7 +780,7 @@ int esp_intr_get_cpu(intr_handle_t handle)
|
|||||||
esp_err_t IRAM_ATTR esp_intr_enable(intr_handle_t handle)
|
esp_err_t IRAM_ATTR esp_intr_enable(intr_handle_t handle)
|
||||||
{
|
{
|
||||||
if (!handle) return ESP_ERR_INVALID_ARG;
|
if (!handle) return ESP_ERR_INVALID_ARG;
|
||||||
portENTER_CRITICAL(&spinlock);
|
portENTER_CRITICAL_SAFE(&spinlock);
|
||||||
int source;
|
int source;
|
||||||
if (handle->shared_vector_desc) {
|
if (handle->shared_vector_desc) {
|
||||||
handle->shared_vector_desc->disabled=0;
|
handle->shared_vector_desc->disabled=0;
|
||||||
@ -796,14 +796,14 @@ esp_err_t IRAM_ATTR esp_intr_enable(intr_handle_t handle)
|
|||||||
if (handle->vector_desc->cpu!=xPortGetCoreID()) return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
if (handle->vector_desc->cpu!=xPortGetCoreID()) return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
||||||
ESP_INTR_ENABLE(handle->vector_desc->intno);
|
ESP_INTR_ENABLE(handle->vector_desc->intno);
|
||||||
}
|
}
|
||||||
portEXIT_CRITICAL(&spinlock);
|
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t IRAM_ATTR esp_intr_disable(intr_handle_t handle)
|
esp_err_t IRAM_ATTR esp_intr_disable(intr_handle_t handle)
|
||||||
{
|
{
|
||||||
if (!handle) return ESP_ERR_INVALID_ARG;
|
if (!handle) return ESP_ERR_INVALID_ARG;
|
||||||
portENTER_CRITICAL(&spinlock);
|
portENTER_CRITICAL_SAFE(&spinlock);
|
||||||
int source;
|
int source;
|
||||||
bool disabled = 1;
|
bool disabled = 1;
|
||||||
if (handle->shared_vector_desc) {
|
if (handle->shared_vector_desc) {
|
||||||
@ -831,12 +831,12 @@ esp_err_t IRAM_ATTR esp_intr_disable(intr_handle_t handle)
|
|||||||
} else {
|
} else {
|
||||||
//Disable using per-cpu regs
|
//Disable using per-cpu regs
|
||||||
if (handle->vector_desc->cpu!=xPortGetCoreID()) {
|
if (handle->vector_desc->cpu!=xPortGetCoreID()) {
|
||||||
portEXIT_CRITICAL(&spinlock);
|
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||||
return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu
|
||||||
}
|
}
|
||||||
ESP_INTR_DISABLE(handle->vector_desc->intno);
|
ESP_INTR_DISABLE(handle->vector_desc->intno);
|
||||||
}
|
}
|
||||||
portEXIT_CRITICAL(&spinlock);
|
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user