altos: Hook up the P1 ISR for TeleBT v0.1 bt_link line
authorKeith Packard <keithp@keithp.com>
Sat, 7 May 2011 05:59:15 +0000 (22:59 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 7 May 2011 05:59:15 +0000 (22:59 -0700)
Otherwise, we're heading off into the weeds...

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao.h
src/ao_btm.c
src/ao_usb.c

index 226f9a2248dd0425ebed6bf27593d245ce796384..600c488a00f98aed631f5a717429690e162e4c57 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -1367,9 +1367,17 @@ ao_packet_slave_init(uint8_t enable);
 
 /* ao_btm.c */
 
-/* Shared by USB, so the USB code calls this function */
+/* If bt_link is on P2, this interrupt is shared by USB, so the USB
+ * code calls this function. Otherwise, it's a regular ISR.
+ */
+
 void
-ao_btm_isr(void);
+ao_btm_isr(void)
+#if BT_LINK_ON_P1
+       __interrupt 15
+#endif
+       ;
+
 
 void
 ao_btm_init(void);
index 490b2667e3c8a78eb412b020f204f59e6c1ad272..172004e9c6aae746f0b30b64201c249e8ba1a57b 100644 (file)
@@ -253,6 +253,9 @@ ao_btm_check_link() __critical
 
 void
 ao_btm_isr(void)
+#if BT_LINK_ON_P1
+       __interrupt 15
+#endif
 {
        if (BT_PIFG & (1 << BT_LINK_PIN_INDEX)) {
                ao_btm_check_link();
index ece6756a030c05bd104e1507a78879bafd54acac..dd7521525f4a08da5e833296e5afb917297bdc6a 100644 (file)
@@ -59,8 +59,10 @@ ao_usb_isr(void) __interrupt 6
        if (USBCIF & USBCIF_RSTIF)
                ao_usb_set_interrupts();
 #if HAS_BTM
+#if BT_LINK_ON_P2
        ao_btm_isr();
 #endif
+#endif
 }
 
 struct ao_usb_setup {