Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/runtime/interrupt/interrupt_esp32c3.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ func handleInterrupt() {
reg.Set(thresholdSave)
riscv.Asm("fence")

// Zero MCAUSE so that interrupt.In() returns false once we
// return to normal (non-interrupt) code. Other RISC-V targets
// (FE310, K210) do the same.
riscv.MCAUSE.Set(0)

// restore MSTATUS & MEPC
riscv.MSTATUS.Set(mstatus)
riscv.MEPC.Set(mepc)
Expand Down
Loading