Enable SYSCLK to set up EXTI...
This commit is contained in:
parent
c76c95c1bd
commit
8a03399dc3
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user