Let the button disable blinking

disable_blink
LEdoian 3 years ago
parent afc41f5ca9
commit eb7fc13fa0

@ -95,12 +95,9 @@ void exti0_isr (void) {
// NB: For some reason it is at the begining in the examples // NB: For some reason it is at the begining in the examples
// It needs to be here (possibly because of reordering, when this was at the end, I usually got the interrupt twice). // It needs to be here (possibly because of reordering, when this was at the end, I usually got the interrupt twice).
if (!running) { // Toggle TIM6 in order to disable blinking
direction = FORWARD; // Code inspired by libopencm3 source, since we cannot read the status otherwise…
} else { TIM_CR1(TIM6) ^= TIM_CR1_CEN;
direction = direction == FORWARD ? BACKWARD : FORWARD;
}
running = true;
} }
void tim6_isr (void) { void tim6_isr (void) {

Loading…
Cancel
Save