Merge branch 'micropeak-1.1'
[fw/altos] / src / drivers / ao_btm.c
index f193ac8ee25c0f4ef3731b33af13b6c8ee2caba5..c862200a8fe01232f199777abe434d2ab4160b49 100644 (file)
@@ -120,7 +120,7 @@ uint8_t
 ao_btm_get_line(void)
 {
        uint8_t ao_btm_reply_len = 0;
-       char c;
+       int c;
 
        for (;;) {
 
@@ -312,18 +312,20 @@ __xdata struct ao_task ao_btm_task;
 #endif
 
 void
-ao_btm_check_link() __critical
+ao_btm_check_link()
 {
-       /* Check the pin and configure the interrupt detector to wait for the
-        * pin to flip the other way
-        */
-       if (BT_LINK_PIN) {
-               ao_btm_connected = 0;
-               PICTL |= BT_PICTL_ICON;
-       } else {
-               ao_btm_connected = 1;
-               PICTL &= ~BT_PICTL_ICON;
-       }
+       ao_arch_critical(
+               /* Check the pin and configure the interrupt detector to wait for the
+                * pin to flip the other way
+                */
+               if (BT_LINK_PIN) {
+                       ao_btm_connected = 0;
+                       PICTL |= BT_PICTL_ICON;
+               } else {
+                       ao_btm_connected = 1;
+                       PICTL &= ~BT_PICTL_ICON;
+               }
+               );
 }
 
 void