Hi,
I customize the firmware (make the changes under based on RAK811\app_5205) and add interrupt handling-
the init code-
Int_1.pin_num = PB3; //pin 15
Int_1.dir = RUI_GPIO_PIN_DIR_INPUT;
Int_1.pull = RUI_GPIO_PIN_PULLUP;
rui_gpio_interrupt(true, Int_1, RUI_GPIO_EDGE_FALL, RUI_GPIO_IRQ_HIGH_PRIORITY, counter_int);
The int routine -
void counter_int()
{
counter++;
}
When adding printing I see that the routine called continuasly.
What is wrong here?
Thanks
Of corse. Not put here all my changes but the definition of PB3 appears earlier in my code: #define PB3 15
The interrupt routine called many times so the pin definition is correct. Maybe the problem with the pull-up resistor? Could you try this small piece of code on your HW?
Thanks
Checked the voltage on the PB3 (the pin with the pullup) and it is 0.
When trying to work with pulldown, only when the scope is connected the interrupt received.
Hi @sagis
I just modified the SDK about PIN_PULL parameter,you can use the following initialization and try again. Int_1.pin_num = 15; Int_1.dir = RUI_GPIO_PIN_DIR_INPUT; Int_1.pull = RUI_GPIO_PIN_PULLUP; rui_gpio_interrupt(true, Int_1, RUI_GPIO_EDGE_FALL, RUI_GPIO_IRQ_HIGH_PRIORITY, counter_int);
After initialization, first measure whether the pin is high level.
Hi @sagis
Sorry, I don’t have a RAK5205 module at home now. Could you please send me your test_app.c and I will directly modify it locally? After that, I will send you an email with the firmware.Or have to wait for a few days will go to work normally. We will update the SDK after local testing in your way.
my email:[email protected]