This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

APP_BUTTON_INIT no longer exists?

The comment above app_button_init says, in part:

 * @note Normally initialization should be done using the APP_BUTTON_INIT() macro

This macro is also mentioned in the documentation. However, I cannot find it anywhere in the code provided. Has it been removed from the SDK?

I'm curious because I'm having trouble getting app_button to work (specifically, channel_port_alloc is failing to allocate a channel) and I'm curious if there's something else I need to initialize.

Thanks!

Parents
  • Looks like app_button_init calls the GPIOTE_CONFIG_IN_SENSE_TOGGLE macro and passes false as the argument, which sets the config to low-accuracy mode. In turn, channel_port_alloc only tries to allocate from an array with GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS elements, which is #defined as 1. In short, this means that I can only have one button? The board support package has multiple buttons, and I'm not sure how they get away with it.

Reply
  • Looks like app_button_init calls the GPIOTE_CONFIG_IN_SENSE_TOGGLE macro and passes false as the argument, which sets the config to low-accuracy mode. In turn, channel_port_alloc only tries to allocate from an array with GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS elements, which is #defined as 1. In short, this means that I can only have one button? The board support package has multiple buttons, and I'm not sure how they get away with it.

Children
No Data
Related