pkarashchenko commented on code in PR #6003:
URL: https://github.com/apache/incubator-nuttx/pull/6003#discussion_r844984967


##########
arch/risc-v/src/esp32c3/esp32c3_irq.c:
##########
@@ -355,7 +355,7 @@ void esp32c3_free_cpuint(uint8_t periphid)
 IRAM_ATTR uintptr_t *esp32c3_dispatch_irq(uintptr_t mcause, uintptr_t *regs)
 {
   int irq;
-  uintptr_t *mepc = regs;
+  uint8_t cpuint = mcause & RISCV_IRQ_MASK;

Review Comment:
   Yes. And using `uintptr_t` + `DEBUGASSERT(cpuint <= ESP32C3_CPUINT_MAX);` 
seems to provide better catching mechanism than `uint8_t` because upper bits 
will not cutoff



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to