cancel
Showing results for 
Search instead for 
Did you mean: 

expected 'const ADC_HandleTypeDef *' but argument is of type 'ADC_HandleTypeDef'

chriskuku
Senior III

Today I started STM32CubeIDE again, was notified that an update is due, installed the update (2.0.0). Got an error alert "Computing 'size'", and the Info startup said "URL not found". Anyway, ignored this, started to build my project again. I added ADC1 (before I did the update), but didn't compile that with the old version of Cube. Now the first compile under the new version fails, saying :

../Drivers/STM32H5xx_HAL_Driver/Inc/stm32h5xx_hal_adc.h:1981:67: note: expected 'const ADC_HandleTypeDef *' but argument is of type 'ADC_HandleTypeDef'
 1981 | uint32_t                HAL_ADC_GetValue(const ADC_HandleTypeDef *hadc);
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

You've passed the handle itself, but the function requires a pointer to the handle.

 

PS:

Here's some instructions for posting formatted text which is not source code - such as compiler output.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

2 REPLIES 2
Andrew Neil
Super User

You've passed the handle itself, but the function requires a pointer to the handle.

 

PS:

Here's some instructions for posting formatted text which is not source code - such as compiler output.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Ah, silly me. I didn't care when using autocompletion (CTRL-Space). Thanks. Is working now.