2022-04-22 05:01 PM
I need to use the ADC ISR to set a FreeRTOS semaphore. It seems that hadc1.ConvCpltCallback is the perfect feature to do this except it's not enabled unless USE_HAL_ADC_REGISTER_CALLBACKS is set. For the life of me I can't figure out how to make MX set this flag. Is it possible?
Solved! Go to Solution.
2022-04-23 01:18 PM
Here's an excerpt for some callback setups in MX from some of our internal project documentation.
1) USE_HAL_TIM_REGISTER_CALLBACKS
set the register callback manually in CubeMx via
Project Manager -> Advanced Settings -> Register Callbacks (far right-hand side).
There you can enable/disable register callbacks for each peripheral individually.
ref: https://community.st.com/s/question/0D50X0000ArRvt6/stmcubeide-usehalregistercallbacks-definition
2022-04-22 06:25 PM
You can also use the global callbacks. Please read the ADC driver source to find names of these global callbacks (they are defined as empty "weak" functions in the HAL driver and you override them by providing your own). Or browse examples in the Cube package.
2022-04-22 06:48 PM
Thanks, that is a workaround. I could also place custom code in the USER CODE BEGIN ADC_IRQn sections. It is pretty annoying to go through the trouble of keeping my project up-to-date with MX, however, just to find something at the end that isn't supported by the tool.
2022-04-23 01:18 PM
Here's an excerpt for some callback setups in MX from some of our internal project documentation.
1) USE_HAL_TIM_REGISTER_CALLBACKS
set the register callback manually in CubeMx via
Project Manager -> Advanced Settings -> Register Callbacks (far right-hand side).
There you can enable/disable register callbacks for each peripheral individually.
ref: https://community.st.com/s/question/0D50X0000ArRvt6/stmcubeide-usehalregistercallbacks-definition
2022-04-23 02:34 PM
You shouldn't compress screenshots to the lossy JPEG, but always use the lossless PNG. Not only PNG will not damage the picture, but will typically be even smaller than JPEG.
2022-04-26 07:00 AM
Thank you for pointing me to this!