I am trying to configure rp2040 function gpio_set_irq_enabled_with_callback on Pico using Arduino IDE with installed Arduino mbed OS because i need some libraries.
When called interrupt happens but then Pico freezes and must be restarted.
Input is from button in rotary encoder.
Printing is set only to see if it's alive. Is the function badly implemented or is it possibble that it doesn't work in Arduino IDE?
I have tried moving the function to void setup() and all possibble events in function.
Here is link to C/C++ SDK page 121
https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf#page=121
#define inputSW 18
void button_callback(uint gpio, uint32_t events){
Serial.println("Interrupt occured");
}
void setup() {
pinMode(inputSW,INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
gpio_set_irq_enabled_with_callback(inputSW, 0x04, 1, &button_callback);
Serial.println("Print");
delay(1000);
}