Enable SYSCLK to set up EXTI...

This commit is contained in:
Lynn Ochs 2021-07-17 00:18:18 +02:00
parent c76c95c1bd
commit 8a03399dc3

View File

@ -20,6 +20,7 @@ static void check(void);
void encoder_setup(void) {
rcc_periph_clock_enable(PIN_RCC);
rcc_periph_clock_enable(RCC_SYSCFG);
gpio_mode_setup(PIN_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, PIN_OPEN | PIN_CLOSE);
@ -29,6 +30,9 @@ void encoder_setup(void) {
nvic_enable_irq(PIN_OPEN_IRQ);
nvic_enable_irq(PIN_CLOSE_IRQ);
// We've configured it, now we can turn it off again
rcc_periph_clock_disable(RCC_SYSCFG);
}
int encoder_get() {