AnsweredAssumed Answered

HAL callback's got me curios

Question asked by on Aug 17, 2016
Latest reply on Aug 18, 2016 by Amel N
Hi guys,

I am currently working on an library myself, and I like the way st is doing certain things, so I am "lending" myself ideas from the HAL.

One thing in particular caught my eye, the callback implementation and it's registration. 

In my opinion the implementation is feasible, but I was wondering about one thing.

If we look at the xx_hal_dma.c/h we can see the function "HAL_DMA_RegisterCallback" which is nice. We certainly expect to find such a function, because we know that the HAL uses callbacks a lot. Now, if we search for the mentioned function, we can't find any usage of it, instead the callbacks are set like this:
/* Set the UART DMA transfer complete callback */
huart->hdmatx->XferCpltCallback = UART_DMATransmitCplt;

So now my curiosity kicks in, and my question is why doesn't st use the provided registering-function? 

I need to say, I didn't check earlier versions of the HAL to see if the register-function is new. 

I would like to know about your opinion on the matter. It could be as simple as the code didn't get updated yet, or maybe you can thing of a technical reason. 

Best Regards