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

long button press / auto reset back to app

I need some help with something very basic... I need a way to upgrade my DFU BLE bootloader to either reset back to the app if no update has been sent after some timeout, OR to add a long button press that would reset back to the app. Can someone give me some pointers how I would go about adding such features? Thank you!

Parents
  • I'm afraid this is too simple code. For long press you should probably listen for any GPIOTE change on the PIN, start timer when it gets pressed (= check GPIO state and start timer could be done in interrupt handler) and then check its counter when another interrupt happens and the GPIO state is the opposite. Look to these two SDK libraries and combine them.

Reply
  • I'm afraid this is too simple code. For long press you should probably listen for any GPIOTE change on the PIN, start timer when it gets pressed (= check GPIO state and start timer could be done in interrupt handler) and then check its counter when another interrupt happens and the GPIO state is the opposite. Look to these two SDK libraries and combine them.

Children
No Data
Related