Hi,
We have a custom device that has 15 buttons. Presently we use the following code to initialize and use the button interrupts. I am using a __WFE(); to wait for the next event (i.e. a button press) however when I press two specific buttons (by design) together it brings the device partially into sleep_mode. This method works sufficient for detecting the button presses, but in attempting to put the device into a lower power mode it seems that some sort of interrupt is triggering the device to come right out of the low power mode or not completely go into low power mode. The device does come out of the "low power (5mA)" mode but completes a reset in the process. The current draw drops from about 9 mA (with I2C device) down to 5 mA (likely, just without I2C device), but never drops to uA levels. My thought is that another interrupt triggers the device to come right out while keeping the I2C device off, but I'm not sure which one would do that.
Searching around I found a handful of explanations of using the BSP module along with a sleep_mode_enter() based on a button press. However, all of the documentation only shows 8 buttons available in the BSP module. Is there the ability to handle more buttons than that, 15 or more? If so what steps would need to be taken to modify the included files to allow for this? Do I need to modify the pca10040.h, bsp.h/c, boards.h/c, others? How so?
Thanks for the help!