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
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_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.
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?
[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.
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)…:
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.