2025-09-09 5:15 AM
I always observe a spike when i start to run the motor which leads to audible noise or jerk when i went through the code to modify i have observed the variable hAux little confusing request to please confirm if it is intended
__weak void *HALL_TIMx_CC_IRQHandler(void *pHandleVoid)
{
if (pHandle->OVFCounter != 0U)
{
/* Adjust the capture using prescaler */
uint16_t hAux;
hAux = hPrscBuf + 1U;
wCaptBuf *= hAux;
again declared
if (pHandle->RatioDec) /* and don't decrease it again */
{
/* Adjust the capture using prescaler */
uint16_t hAux;
hAux = hPrscBuf + 2U;
wCaptBuf *= hAux;
again declared
else /* If prescaler was not modified on previous capture */
{
/* Adjust the capture using prescaler */
uint16_t hAux = hPrscBuf + 1U;
wCaptBuf *= hAux;