xtensa/esp32: fix cpuint debug asssertion bit mask

This commit is contained in:
Filipe Cavalcanti 2024-09-25 10:18:23 -03:00 committed by Petro Karashchenko
parent a876f00e2a
commit b3d0dca84e
2 changed files with 6 additions and 2 deletions

View file

@ -45,6 +45,11 @@
#define ESP32_CPUINT_FLAG_SHARED (1 << 2) /* Interrupt can be shared between ISRs */
#define ESP32_CPUINT_FLAG_IRAM (1 << 3) /* ISR can be called if cache is disabled */
/* Trigger mask useful on debug assertion */
#define ESP32_CPUINT_TRIGGER_MASK (ESP32_CPUINT_FLAG_LEVEL | \
ESP32_CPUINT_FLAG_EDGE)
/* Interrupt Matrix
*
* The Interrupt Matrix embedded in the ESP32 independently allocates

View file

@ -393,8 +393,7 @@ static int esp32_alloc_cpuint(int cpu, int priority, int type)
DEBUGASSERT(priority >= ESP32_MIN_PRIORITY &&
priority <= ESP32_MAX_PRIORITY);
DEBUGASSERT(type == ESP32_CPUINT_LEVEL ||
type == ESP32_CPUINT_EDGE);
DEBUGASSERT(type & ESP32_CPUINT_TRIGGER_MASK);
if ((type & (ESP32_CPUINT_LEVEL | ESP32_CPUINT_EDGE)) == 0)
{