Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TIM_TypeDef *TimList0[] = { TIM1 , TIM3 , TIM6 , TIM14 , TIM15 , TIM16 , TIM17 };
- TIM_TypeDef *TimList1[] = { TIM1 , TIM3 , TIM14 , TIM15 , TIM16 , TIM17 };
- TIM_TypeDef *TimList2[] = { TIM1 , TIM3 , TIM15 };
- TIM_TypeDef *TimList3[] = { TIM1 , TIM3 };
- TIM_TypeDef *TimList4[] = { TIM1 , TIM3 };
- TIM_TypeDef *TimList5[] = { TIM1 , TIM15 , TIM16 , TIM17 };
- TIM_TypeDef *TimList6[] = { TIM1 , TIM3 , TIM15 };
- TIM_TypeDef *TimList7[] = { TIM1 , TIM15 , TIM16 , TIM17 };
- TIMER_Irq_Cfg_t sTimIRQnCfg[] =
- {
- { TIMER_UPDATE_IRQ, TIM_DIER_UIE, 7, ( TIM_TypeDef* )TimList0 },
- { TIMER_CAPTURE_COMPARE_1_IRQ, TIM_DIER_CC1IE, 6, ( TIM_TypeDef* )TimList1 },
- { TIMER_CAPTURE_COMPARE_2_IRQ, TIM_DIER_CC2IE, 3, ( TIM_TypeDef* )TimList2 },
- { TIMER_CAPTURE_COMPARE_3_IRQ, TIM_DIER_CC3IE, 2, ( TIM_TypeDef* )TimList3 },
- { TIMER_CAPTURE_COMPARE_4_IRQ, TIM_DIER_CC4IE, 2, ( TIM_TypeDef* )TimList4 },
- { TIMER_COM_IRQ, TIM_DIER_COMIE, 4, ( TIM_TypeDef* )TimList5 },
- { TIMER_TRIGGER_IRQ, TIM_DIER_TIE, 3, ( TIM_TypeDef* )TimList6 },
- { TIMER_BREAK_IRQ, TIM_DIER_BIE, 4, ( TIM_TypeDef* )TimList7 },
- };
- void TIMEREnableInterrupt( TIM_TypeDef *pTim, TIMER_IRQ_t Irq )
- {
- for ( uint8_t Index = 0; Index < 8; Index++ )
- {
- if ( Irq == sTimIRQnCfg[Index].IRQn ) // Interrupt suchen..
- {
- for ( uint8_t IndexTimList = 0; IndexTimList < sTimIRQnCfg[Index].uiSizeOfTims; IndexTimList++ ) // Timer durchgehen..
- {
- if ( pTim == ( TIM_TypeDef* ) sTimIRQnCfg[Index].pTim + IndexTimList )
- {
- pTim->DIER |= sTimIRQnCfg[Index].uiRQn;
- }
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement