cancel
Showing results for 
Search instead for 
Did you mean: 

TOUCH GFX :: EXTI Callback, multiple definition ERROR.

Sellyette
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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.

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
Sarra.S
ST Employee

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.

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.

TDK
Guru

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.

 

If you feel a post has answered your question, please click "Accept as Solution".

Thank you very much for your answer.