trying to follow the processor manual
diff --git a/gyro_board/src/usb/analog.c b/gyro_board/src/usb/analog.c
index cfcd67d..7a47a2f 100644
--- a/gyro_board/src/usb/analog.c
+++ b/gyro_board/src/usb/analog.c
@@ -160,9 +160,6 @@
// ENC1A 2.11
void EINT1_IRQHandler(void) {
- // TODO(brians): need to test this on hardware, but I think this should be
- // below the EXTPOLAR set
- SC->EXTINT = 0x2;
int fiopin = GPIO2->FIOPIN;
if (((fiopin >> 1) ^ fiopin) & 0x800) {
++encoder1_val;
@@ -170,10 +167,10 @@
--encoder1_val;
}
SC->EXTPOLAR ^= 0x2;
+ SC->EXTINT = 0x2;
}
// ENC1B 2.12
void EINT2_IRQHandler(void) {
- SC->EXTINT = 0x4;
int fiopin = GPIO2->FIOPIN;
if (((fiopin >> 1) ^ fiopin) & 0x800) {
--encoder1_val;
@@ -181,6 +178,7 @@
++encoder1_val;
}
SC->EXTPOLAR ^= 0x4;
+ SC->EXTINT = 0x4;
}
// GPIO Interrupt handlers