This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupts on third-party board.

Hello!

I am currently working with Actinius' Icarus IoT board and I'm trying to get the interrupts to work. This is the boards' pin layout:

At the moment I have connected the 0 pin to a button and the 1 pin to a LED. My goal is to make the button trigger an interrupt that executes a function and turns on the LED light.
I have seen the blinky example and tried to modify it with little success.

I know that my "problem" is rather vague and is more a lack of skill and knowledge than a dysfunction with the board or the library. However, I cannot make it work and I would like just a pinpoint of where I have to start. Maybe I'm including the wrong library, using the wrong functions, or having the definitions all messed up. 

I appreciate your time and help, thank you in advance!


 

  • Yes, you are correct, the alias was a part of the problem. However, I got the error while I was trying to define the button like this:

    #define BUTTON_NODE    		DT_NODELABEL(sw1)
    #define BUTTON_GPIO_LABEL	DT_GPIO_LABEL(BUTTON_NODE, gpios)
    #define BUTTON_GPIO_PIN		DT_GPIO_PIN(BUTTON_NODE, gpios)
    #define BUTTON_GPIO_FLAGS	GPIO_INPUT | DT_GPIO_FLAGS(BUTTON_NODE, gpios)

    but this got fixed when I change it to this:

    #define BUTTON_NODE    		DT_GPIO_PIN(DT_NODELABEL(sw1), gpios)
    #define BUTTON_GPIO_LABEL	DT_GPIO_LABEL(BUTTON_NODE, gpios)
    #define BUTTON_GPIO_FLAGS	GPIO_INPUT | DT_GPIO_FLAGS(BUTTON_NODE, gpios)
    

  • Everything works with the second implementation? I would expect the first one to work if DT_NODELABEL were changed to DT_ALIAS.

Related