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

ISR action following wakeup

Hi,

I'm attempting to wake the nrf52480 from it's sleep mode using a button input and sequentially send the command normally associated with that button without requiring a second press.  I am a bit new to ISR usage, so forgive me if this is a rather naive question.   

I have read a through a handful of threads on this forum, but have yet to come across a similar situation.  I attempted to build a solution upon your pwr_mgmt_pca10056 example to wake the board and turn on an LED.  Is this a reasonable starting point?  Or do I need to get further into GPIOTE to do what I'm attempting?

Thanks,

  • Hello,

    if you want to check what button that woke you up, I believe the easiest approach would be to check the button states on startup.

    Some of our BLE examples support something called bonding, but most of our examples have this function in main():

    buttons_leds_init(&erase_bonds);

    What this does is to check whether a certain button is pressed on startup, to decide whether or not to delete bonding information. 

    E.g. the ble_app_uart example has this functionality implemented. Please check out how it checks the button press and forwards that information to the erase_bonds variable. Perhaps you can use something similar to this in your application?

    NB: By default, there is nothing telling the application what pin that actually woke up the nRF.

    Best regards,

    Edvin

  • Thanks, Edvin.  

    Ended up checking all button status within buttons_leds_init(&erase_bonds); and setting a bool flag for the one whose depression resulted in the wake event. 

    Appreciate the help.

Related