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

How to get the push event while button is pushing when system starting up

I'm use the app_button lib to deal with button event ,things go well, I assign the push ,release and long push event to button event .

But there came a situation,while the button is pressed at system starting,I can't capture the push and release event at this situation.

How can I capture the push event like this situation?

Realy thanks

Parents
  • Hi,

    It's not possible to differentiate between a short button push and long one on startup. You can however check if the button was held down on startup by manually configuration the pin as input and reading its state before initializing the app button module. We use this approach to clear bonding data in our examples that support bonding. I.e., holding button 2 pressed while resetting the device clears bonding information. 

Reply
  • Hi,

    It's not possible to differentiate between a short button push and long one on startup. You can however check if the button was held down on startup by manually configuration the pin as input and reading its state before initializing the app button module. We use this approach to clear bonding data in our examples that support bonding. I.e., holding button 2 pressed while resetting the device clears bonding information. 

Children
Related