QN9080-001-M17-Button function settings

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9080-001-M17-Button function settings

451 Views
1758793535
Contributor I

hi

I don't quite understand which of the following functions can set the duration of button pressing.

I want to change the button setting in the red circle to one that takes a long time to press.

For example, after I press for 5 seconds, the following program will be executed

5LB4GUQPI7EY2FE]6BF6MN8.png

 

0 Kudos
1 Reply

422 Views
nxf56274
NXP Employee
NXP Employee

Hi,

你创建了好几个post,我们就在这个post下讨论吧。

关于按键含义gKBD_EventLongPB1_c和gKBD_EventHoldPB1_c,前者就是按的时间长一点,后者是按着不放。按键的检测是在keyboard.c的KeyScan里实现的,里面有判断语句

if(mLongKeyCount >= gKbdLongKeyIterations_c)
{
keyBase = gKBD_EventLongPB1_c;
}
if(mLongKeyCount >= gKbdVeryLongKeyIterations_c)
{
keyBase = gKBD_EventVeryLongPB1_c;
}

gKbdLongKeyIterations_c这个宏定义是定义的按的时间长短,gKbdLongKeyIterations宏定义为20ms,gKbdVeryLongKeyIterations_c定义为160ms,你要实现长时间按键应该是改这两个值,产生对应的case,然后在BleApp_HandleKeys实现这个情况

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos