Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
159
Ver.1.0.0
Figure 7-3 Keyscan Time Optimization
As shown above, it will first check whether IRQ flag bit is set after previous keyscan is
finished. If yes, it indicates there’s button press action during this duration; since manual
button press lasts for 200ms at least, the pressed button is not released yet, and the
subsequent basic keyscan flow (including full scan and row-by-row scan) will be
executed.
After the pressed button is released, the debounce function in kb_key_pressed takes
effect. Only when six successive detections all show button release state, the keyscan
flow will be stopped.
7.5 Deepsleep Wakeup Fast Keyscan
After Slave enters deepsleep during connection state, it can be woke up by button press
action. After wakeup, firmware is rebooted; in mainloop following user_init, Slave will first
send adv packets, establishes connection, and then sends the key value to BLE Master.
Though 5316 BLE SDK adopts some processing to speed up the deepback (resumption
after wakeup from deepsleep), the duration may still reach several hundreds of
milliseconds (e.g. 300ms). To avoid action loss of the wakeup pin, fast keyscan and data
buffer are added. Fast keyscan is designed to avoid potential button action loss caused
by re-initialization time after MCU reboots and debounce filter processing time during