Skip to content

panic when Interrupts enabled in RP Pico #2653

@bmentink

Description

@bmentink

I am getting: panic: runtime error: nil pointer dereference .. whenever I enable interrupts in my test code.
The interrupt handler does not seem to be doing anything .. (do println statements work in the handler?)

Is there any way to find where the Panic is occurring? Is there a good example for using Interrupts on the Pico?

I am essentially doing the following to use interrupts:

//Interrupt pin:
comp_A.Configure(machine.PinConfig{Mode: machine.PinInputPullup})

//Set interrupt (presume interrupt is now enabled)
comp_A.SetInterrupt(machine.PinRising, handlerA_rising)

// Handler
func handlerA_rising(p machine.Pin) {
comp_A.SetInterrupt(0, nil)) // Disable interrupt !! not sure if you have to disable interrupt to ensure another one does not happen in this handler ???
///.... do stuff
}

Any idea's

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about usage of TinyGorp2040RP2040 (Pi Pico, RP2040 Feather, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions