src/TLx4966/TLx4966.c
/**
 * @brief       Updates the sensor speed. 
 *              A rising edge is detected when the gpio voltage level changes from low to high.
 * 
 * @note        To be used in super-loop.           
 * @param[in]   handle  Pointer to the sensor entity handle
 * @return      void        
 */
@brief       Updates the sensor speed.
A rising edge is detected when the gpio voltage level changes from low to high.

@note        To be used in super-loop.
@param[in]   handle  Pointer to the sensor entity handle
@return      void
@brief Updates the sensor speed . A rising edge is detected when the gpio voltage level changes from low to high . @note To be used in super - loop . @param [ in ] handle Pointer to the sensor entity handle @return void
void TLx4966_UpdateSpeed(TLx4966_Handle_t *handle)
{
    static bool waitingRisingEdge = true;
    if(waitingRisingEdge && (handle->hwIntf->speed->read() == TLx4966_GPIO_HIGH))
    {
        TLx4966_CalculateSpeed(handle);
        handle->hwIntf->timer->stop();
        handle->hwIntf->timer->start();
        waitingRisingEdge = false;
    }
    else if(!waitingRisingEdge && (handle->hwIntf->speed->read() == TLx4966_GPIO_LOW))
    {
        waitingRisingEdge = true;
    }
}
void TLx4966_UpdateSpeed ( TLx4966_Handle_t * handle ) { static bool waitingRisingEdge = true ; if ( waitingRisingEdge && ( handle -> hwIntf -> speed -> read ( ) == TLx4966_GPIO_HIGH ) ) { TLx4966_CalculateSpeed ( handle ) ; handle -> hwIntf -> timer -> stop ( ) ; handle -> hwIntf -> timer -> start ( ) ; waitingRisingEdge = false ; } else if ( ! waitingRisingEdge && ( handle -> hwIntf -> speed -> read ( ) == TLx4966_GPIO_LOW ) ) { waitingRisingEdge = true ; } }
@brief       Updates the sensor speed.
@brief Updates the sensor speed .