- ao_quadrature_count = 0;
-
- ao_enable_port(AO_QUADRATURE_PORT);
- ao_exti_setup(AO_QUADRATURE_PORT, AO_QUADRATURE_A,
- AO_EXTI_MODE_PULL_UP|AO_EXTI_MODE_FALLING|AO_EXTI_MODE_RISING|AO_EXTI_PRIORITY_MED,
- ao_quadrature_isr);
- ao_exti_enable(AO_QUADRATURE_PORT, AO_QUADRATURE_A);
- ao_exti_setup(AO_QUADRATURE_PORT, AO_QUADRATURE_B,
- AO_EXTI_MODE_PULL_UP|AO_EXTI_MODE_FALLING|AO_EXTI_MODE_RISING|AO_EXTI_PRIORITY_MED,
- ao_quadrature_isr);
- ao_exti_enable(AO_QUADRATURE_PORT, AO_QUADRATURE_B);
+#if AO_QUADRATURE_COUNT > 0
+ init(0);
+#endif
+#if AO_QUADRATURE_COUNT > 1
+ init(1);
+#endif
+ ao_fast_timer_init();
+ ao_fast_timer_on(ao_quadrature_isr);