little fix

This commit is contained in:
eddyem 2016-12-29 15:07:19 +03:00
parent bdcc9d7b01
commit edcc1fd563
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -54,8 +54,10 @@ void tim2_isr(){
static uint16_t ctr = 0; static uint16_t ctr = 0;
if(TIM2_SR & TIM_SR_UIF){ // update interrupt if(TIM2_SR & TIM_SR_UIF){ // update interrupt
if(ctr > pulsesLen) ctr = 0; if(ctr > pulsesLen) ctr = 0;
if(pulses[++ctr]) gpio_set(OUTP_PORT, OUTP_PIN); if(pulses[++ctr])
else gpio_clear(OUTP_PORT, OUTP_PIN); GPIO_BSRR(OUTP_PORT) = OUTP_PIN;
else
GPIO_BSRR(OUTP_PORT) = OUTP_PIN << 16;
TIM2_SR = 0; TIM2_SR = 0;
} }
} }