diff --git a/arch/xtensa/include/esp32/irq.h b/arch/xtensa/include/esp32/irq.h index 05b273468f..7cc1311554 100644 --- a/arch/xtensa/include/esp32/irq.h +++ b/arch/xtensa/include/esp32/irq.h @@ -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 diff --git a/arch/xtensa/src/esp32/esp32_irq.c b/arch/xtensa/src/esp32/esp32_irq.c index f169ccf464..5490944452 100644 --- a/arch/xtensa/src/esp32/esp32_irq.c +++ b/arch/xtensa/src/esp32/esp32_irq.c @@ -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) {