Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: BREMS/BREMSConfig.cpp
- Revision:
- 91:f58472ac3fae
- Parent:
- 90:2ef53b1a22de
- Child:
- 92:a9dac72d8cac
--- a/BREMS/BREMSConfig.cpp Tue Apr 04 04:05:37 2017 +0000 +++ b/BREMS/BREMSConfig.cpp Wed Apr 05 20:57:18 2017 +0000 @@ -22,13 +22,13 @@ NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn); //Enable TIM1 IRQ TIM1->DIER |= TIM_DIER_UIE; //enable update interrupt - TIM1->CR1 = 0x40; //CMS = 10, interrupt only when counting up + TIM1->CR1 = 0x00; //CMS = 10, interrupt only when counting up TIM1->CR1 |= TIM_CR1_ARPE; //autoreload on, - TIM1->RCR |= 0x01; //update event once per up/down count of tim1 + TIM1->RCR |= 0x00; //update event once per up/down count of tim1 TIM1->EGR |= TIM_EGR_UG; TIM1->PSC = 0x00; //no prescaler, timer counts up in sync with the peripheral clock - TIM1->ARR = (int) ((float) 9e7 / F_SW); + TIM1->ARR = (int) (2 * (float) 9e7 / F_SW); TIM1->CCER |= ~(TIM_CCER_CC1NP); //Interupt when low side is on. TIM1->CR1 |= TIM_CR1_CEN;