mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 10:45:11 +03:00
little fix
This commit is contained in:
parent
bdcc9d7b01
commit
edcc1fd563
Binary file not shown.
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user