src/stm32f10x_it.c
/**
 * @brief  This function handles External line 0 interrupt request.
 * @param  None
 * @retval None
 */
@brief  This function handles External line 0 interrupt request.
@param  None
@retval None
@brief This function handles External line 0 interrupt request . @param None @retval None
void EXTI0_IRQHandler(void)
{
	if (EXTI_GetITStatus(EXTI_Line0) == RESET || autonomous_mode) {
		EXTI_ClearITPendingBit(EXTI_Line0);
		return;
	}
	TickType_t timeElapsed = xTaskGetTickCount();
	if (ppmChannel0 > 0 && timeElapsed - CONTROLLER_WARMUP >= ppmLastTimeout) {
		int diff = timeElapsed - ppmChannel0;
		if (diff > 0 && ppmPrevDiff0 > diff) {
			updateSteering(diff * (1000000.0 / configTICK_RATE_HZ), enableL, enableR);
		}
		ppmPrevDiff0 = diff;
	}
	ppmChannel0 = timeElapsed;
	EXTI_ClearITPendingBit(EXTI_Line0);
}
void EXTI0_IRQHandler ( void ) { if ( EXTI_GetITStatus ( EXTI_Line0 ) == RESET || autonomous_mode ) { EXTI_ClearITPendingBit ( EXTI_Line0 ) ; return ; } TickType_t timeElapsed = xTaskGetTickCount ( ) ; if ( ppmChannel0 > 0 && timeElapsed - CONTROLLER_WARMUP >= ppmLastTimeout ) { int diff = timeElapsed - ppmChannel0 ; if ( diff > 0 && ppmPrevDiff0 > diff ) { updateSteering ( diff * ( 1000000.0 / configTICK_RATE_HZ ) , enableL , enableR ) ; } ppmPrevDiff0 = diff ; } ppmChannel0 = timeElapsed ; EXTI_ClearITPendingBit ( EXTI_Line0 ) ; }
@brief  This function handles External line 0 interrupt request.
@brief This function handles External line 0 interrupt request .
// Avoids calculating the difference on the first run // Avoids using the longest part of the wave // Clears the EXTI line 0 pending bit