123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include "InputCapture.h"
- #include "bikespeed.h"
- #include "Cadence.h"
- #include "FSM_1st.h"
- #include "api.h"
- #include "board_config.h"
- void IC_CountMaxISR(void)
- {
- if(switch_flg.SysCoef_Flag == TRUE)
- {
- UWORD uwIntSource = 1;
- cadence_voCadenceCal(uwIntSource);
- bikespeed_voBikeSpeedCal(uwIntSource);
- }
- }
- void IC_CadenceISR(void)
- {
- if(switch_flg.SysCoef_Flag == TRUE)
- {
- UWORD uwIntSource = 2;
- cadence_voCadenceCal(uwIntSource);
-
- /* Select rising or falling edge trigger */
- if(iGpio_Read(HW_GPIO_CADENCE_PIN) != 0)
- {
- /* reset the CH2P and CH2NP bits */
- // TIMER_CHCTL2(TIMER1) &= ~(uint32_t)(TIMER_CHCTL2_CH2P|TIMER_CHCTL2_CH2NP);
- // TIMER_CHCTL2(TIMER1) |= (uint32_t)((uint32_t)(TIMER_IC_POLARITY_FALLING) << 8U);
- iCap_SetEdgeType(0, CAP_CH(2), ApiCap_FallingEdge);
- }
- else
- {
- /* reset the CH2P and CH2NP bits */
- // TIMER_CHCTL2(TIMER1) &= ~(uint32_t)(TIMER_CHCTL2_CH2P|TIMER_CHCTL2_CH2NP);
- // TIMER_CHCTL2(TIMER1) |= (uint32_t)((uint32_t)(TIMER_IC_POLARITY_RISING) << 8U);
- iCap_SetEdgeType(0, CAP_CH(2), ApiCap_RisingEdge);
- }
- }
- }
- void IC_BikeSpdISR(void)
- {
- if(switch_flg.SysCoef_Flag == TRUE)
- {
- UWORD uwIntSource = 3;
- bikespeed_voBikeSpeedCal(uwIntSource);
- }
- }
|