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

AN36 button state

As far as I can see buttons_init() initializes GPIO and sets up button_event_handler(). button_event_handler() calls ble_lbs_on_button_change() and always set static uint8_t set_push to 1, which is written to params.p_data and transferred to sd_ble_gatts_hvx().At the end uint set_push is logically inverted. If I understood this logic correctly than the code does NOT read the current button state but makes an assumption that it has been changed to inverse and modifies set_push every time ble_lbs_on_button_change() is called. Am I reading this correctly?

Related