fix(esp_hw_support): clear reserved interrupts that are not applicable for each target

This commit is contained in:
Omar Chebib
2024-03-12 11:01:51 +08:00
parent 1439815d57
commit 16d957e7aa
14 changed files with 271 additions and 225 deletions

View File

@@ -622,7 +622,7 @@ esp_err_t esp_intr_alloc_intrstatus(int source, int flags, uint32_t intrstatusre
esp_intr_disable(ret);
}
#ifdef SOC_CPU_HAS_FLEXIBLE_INTC
#if SOC_CPU_HAS_FLEXIBLE_INTC
//Extract the level from the interrupt passed flags
int level = esp_intr_flags_to_level(flags);
esp_cpu_intr_set_priority(intr, level);
@@ -634,6 +634,11 @@ esp_err_t esp_intr_alloc_intrstatus(int source, int flags, uint32_t intrstatusre
}
#endif
#if SOC_INT_PLIC_SUPPORTED
/* Make sure the interrupt is not delegated to user mode (IDF uses machine mode only) */
RV_CLEAR_CSR(mideleg, BIT(intr));
#endif
portEXIT_CRITICAL(&spinlock);
//Fill return handle if needed, otherwise free handle.