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

Button long press strange behaviour(SDK12.3)

main.cHi,

I have implemented button long press with APP_BUTTON library with APP timer (a 5 seconds timer). Normally the detection works fine.

But I found that if the system has been left running for a period of time, it will immediate trigger the long press handler when i press the button (instead of after 5 seconds).

The pin in question is P0 (update. tested on another button have similar effect)

Any idea on this??

Thanks.

Parents
  • Hello, about the

    It is initialised **in main**: APP_TIMER_DEF(button_power_5sec_timer_id); //define 5 second timer id

    you mean you have defined that inside the main function like this?

    int main(void) {
       APP_TIMER_DEF(button_power_5sec_timer_id);
       // ...
       return 0; }
    

    or is that defined outside the main function?

    How about uploading your source C file in your original post? Then I think we can speed things up.

Reply
  • Hello, about the

    It is initialised **in main**: APP_TIMER_DEF(button_power_5sec_timer_id); //define 5 second timer id

    you mean you have defined that inside the main function like this?

    int main(void) {
       APP_TIMER_DEF(button_power_5sec_timer_id);
       // ...
       return 0; }
    

    or is that defined outside the main function?

    How about uploading your source C file in your original post? Then I think we can speed things up.

Children
No Data
Related