2023-09-20 05:58 AM - edited 2023-09-20 06:00 AM
Hi, Thank you for reading it.
I made project using TouchGFX.
I want to use a EXTI Falling Edge. (it will be use IRQ)
I add the weak function. please see my code
app_freertos.c
void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin) {
UNUSED(GPIO_Pin);
}
when compile, I have following error.
TouchGFX/Target/STM32TouchController.cpp:53: multiple definition of `HAL_GPIO_EXTI_Falling_Callback'
So, I open the target source file.
STM32TouchController.cpp
extern "C" void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == TS_INT_PIN)
{
if (_initialized)
{
if (BSP_TS_GetState(0, &state) != BSP_ERROR_NONE)
{
assert(0 && "Failed to read TS state");
}
}
}
}
same name functions are in a one project.
So I disabled the funtion in STM32TouchController.cpp.
Then I can not touch anything in display.
please let me know how to avoid the error and to work two function (touch and irq falling edge exti).
thanks
Solved! Go to Solution.
2023-09-20 02:59 PM
Since TouchGFX is already using that callback, you can't redefine it in your user code.
You can either modify the TouchGFX code, or the interrupt handler code, or find some other method to achieve your results.
2023-09-20 07:17 AM
Hello @Sellyette,
As you have already figured out, the issue is the fact that you have two functions with the same name, one defined in app_freertos.c and the other in STM32TouchController.cpp.
To fix this, you can rename it as my_HAL_GPIO_EXTI_Falling_Callback in app_freertos.c
Hope that helps!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-20 07:36 AM
Hello @Sarra.S
As you know, The name of the function is for EXTI.
If I rename the name of function, what I can do EXT Interrupt?
Both app_freertos.c and STM32TouchController.cpp use the EXTI.
If I rename any function, the renamed function can not work for EXTI.
Thankyou for ur answer.
2023-09-20 02:59 PM
Since TouchGFX is already using that callback, you can't redefine it in your user code.
You can either modify the TouchGFX code, or the interrupt handler code, or find some other method to achieve your results.
2023-09-22 01:36 AM
Thank you very much for your answer.