From 1a54a58d72147888f783a3caf364479efff4ed9b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 7 Apr 2011 22:00:38 -0700 Subject: altos: Use PIO(6) on BTM to monitor BT connection. Fix BTM init. PIo(6) appears to be an active-low indication of the Bluetooth connection status. Hook this up using an interrupt to track the link state instead of using in-band status messages. Signed-off-by: Keith Packard --- src/ao_usb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ao_usb.c') diff --git a/src/ao_usb.c b/src/ao_usb.c index b4e3f1fe..ece6756a 100644 --- a/src/ao_usb.c +++ b/src/ao_usb.c @@ -46,6 +46,7 @@ void ao_usb_isr(void) __interrupt 6 { USBIF = 0; + IRCON2 &= ~IRCON2_USBIF; ao_usb_iif |= USBIIF; if (ao_usb_iif & 1) ao_wakeup(&ao_usb_task); @@ -57,6 +58,9 @@ ao_usb_isr(void) __interrupt 6 if (USBCIF & USBCIF_RSTIF) ao_usb_set_interrupts(); +#if HAS_BTM + ao_btm_isr(); +#endif } struct ao_usb_setup { -- cgit v1.2.3