LPC SDK 2.12 button component bug

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

LPC SDK 2.12 button component bug

959 Views
A_M
Contributor III

Hello,

the fsl_component_button have a bug. There is no initialisation of the timer.
Therefore only the double click event is reported no matter how the button is pressed.

The bug seems to be in all LPC54xxx SDKs.

Tested SDK_2_12_0_LPC54005 & SDK_2_12_0_LPC54608J512

0 Kudos
Reply
5 Replies

915 Views
A_M
Contributor III

Hello,

I expect that when I enable the klick functions(one/double/short/long), define the threshold time in fsl_component_button.h and call
BUTTON_Init((button_handle_t)s_buttonHandle, &buttonConfig);
BUTTON_InstallCallback(&s_buttonHandle, button_callback, NULL);.
That then I get result in button_callback.

But the only event that I get is double klick. The timer to measure the threshold time is not initialized.

There must be an initialization call TM_Init(…) in BUTTON_OpenTimer but its not.

My fix is in fsl_component_button.h is in the zip Line 309 – 314.

 

0 Kudos
Reply

907 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @A_M ,

Could you please try using the following code for fsl_component_button.c in function BUTTON_OpenTimer instead of using your configuration?

RaulRomero_0-1674670636543.png

[button component of LPCXpresso54608]

Checking the button component in LPC54608 and comparing the one in LPCXpresso54608, some lines of the code above are missing. Could you please try your code using the underlined lines?

Please let us know if this actually helps you to work out the button component.

Regards, Raul.

0 Kudos
Reply

904 Views
A_M
Contributor III

Hello Raul,

no it dosn help.

button_callback still post doubleklick only.

0 Kudos
Reply

885 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @A_M,

Looking at the button component API and seeing the base example to demonstrate how to use the button component; to which you can access through Import SDK example(s)…:

RaulRomero_0-1674842174578.png

The button component is expecting that you do the initialization of the timer TM_Init() by yourself; in the example is at main before BUTTON_Init() and BUTTON_InstallCallback(), but the way that you did it is also right.

Best regards, Raul.

0 Kudos
Reply

940 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @A_M,

Could you please tell us how are you testing this? What are you expecting to do, or which functions are you expecting to enter with the initialization of the timer?

Best regards, Raul.

0 Kudos
Reply