2016-06-23 08:03 AM
I am a little confused with this call back function HAL_CAN_RxCpltCallback(). The end users are supposed to implement this function but there is already one in the file: stm32f0xx_hal_can.c. STM recommends do not modify this function in the file but recommend that you have to implement your own version of the function. So wouldn't it cause some sort of conflict? I tried to implement HAL_CAN_RxCpltCallback()
in my main() to test it out but the compiler doesn't complain. So basically there are two identical functions. How does the program know which function to call?2016-06-23 10:26 AM
Hi vu.andy,
Most of call-back functions found in the drivers are defined as weak function. It up to user to create its own call-back and manage the processing when the CPU or DMA interruptions occurs. When call back function is created by user, it is the one considered for the project and has the high priority than the weak one. -Hannibal-