cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE problem with callback function

OM
Associate II

Hi,

I have writen simple callback function for handle end of ADC convertion in main.c file.

In main.h is declared

extern void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc);

main.c

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
adc_Complete = 1;
}

After command Build All in Project menu is result:

../Core/Src/main.c:203:6: warning: 'HAL_ADC_ConvCpltCallback' defined but not used [-Wunused-function]

My callback function is not used for interrupt handling of course.

In the past I dindn't find any problem with callback in Keil system.

What I do need set in STM32CubeIDE to solve this problem?

Thank you for help.

1 ACCEPTED SOLUTION

Accepted Solutions
OM
Associate II

Thank you for your reply.

I did write new souce file in project. I have put there callback function and removed this function from main.c and main.h. And now it is work correctly. I don't know why.

View solution in original post

2 REPLIES 2
TDK
Guru

Search your project for uses of HAL_ADC_ConvCpltCallback, are there any? There should be several in stm32f4xx_hal_adc.c.

Do you have HAL_ADC_MODULE_ENABLED defined?

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

Thank you for your reply.

I did write new souce file in project. I have put there callback function and removed this function from main.c and main.h. And now it is work correctly. I don't know why.