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

Strange app_button behaviour in SDK v6.0

Moving from SDK version 5.1 to 6.0, the buttons on my PCA20006 beacons no longer works as expected. When I press a button, it seems to register the release of a button incorrectly, even though I have modified my code according to the changes in "button_app.h" with the new "button_action" parameter:

    #define APP_BUTTON_PUSH        1            /**< Indicates that a button is pushed. */
    #define APP_BUTTON_RELEASE     0           /**< Indicates that a button is released. */
   ...    
      typedef struct
        {
            app_button_handler_t button_handler;
            uint8_t              pin_no;
            uint8_t              button_action;  //*** New, APP_BUTTON_PUSH or APP_BUTTON_RELEASE
        } app_button_event_t;

The problem may also be related to this previous post (Link), but I still couldn't figure how to fix it. There are absolutely no documentation about the changes and this new behaviour. This pretty much breaks all my previous button action related code based on SDK 5.1. I spent a day trying to fix my code for this new "button_app.h"/"button_app.c" but with no luck. I ended up using the old "button_app.h"/"button_app.c" from SDK 5.1 and all the button actions worked flawlessly as expected.

Please fix this or at least inform us the correct way of using the new "button_app.h"/"button_app.c". Thanks.

Justin

Related