cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification on the Hall Interrupt

STuser2
Senior

STuser2_0-1757419669568.pngSTuser2_1-1757419688398.png

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;

 

 

0 REPLIES 0