-/*
- * Connect directly to the bluetooth device, mostly
- * useful for testing
- */
-static void
-ao_btm_forward(void)
-{
- char c;
-
- ao_btm_chat = 1;
- ao_wakeup(&ao_btm_connected);
- ao_usb_flush();
- while ((c = ao_usb_getchar()) != '~') {
- if (c == '\n') c = '\r';
- ao_btm_putchar(c);
- }
- ao_btm_chat = 0;
- while (!ao_btm_running) {
- ao_wakeup(&ao_usart1_rx_fifo);
- ao_delay(AO_MS_TO_TICKS(10));
- }
-}
-
-/*
- * Dump everything received from the bluetooth device during startup
- */
-static void
-ao_btm_dump(void)
-{
- int i;
- char c;
-
- for (i = 0; i < ao_btm_ptr; i++) {
- c = ao_btm_buffer[i];
- if (c < ' ' && c != '\n')
- printf("\\%03o", ((int) c) & 0xff);
- else
- putchar(ao_btm_buffer[i]);
- }
- putchar('\n');
-}
-
-static void
-ao_btm_speed(void)
-{
- ao_cmd_decimal();
- if (ao_cmd_lex_u32 == 57600)
- ao_serial_set_speed(AO_SERIAL_SPEED_57600);
- else if (ao_cmd_lex_u32 == 19200)
- ao_serial_set_speed(AO_SERIAL_SPEED_19200);
- else
- ao_cmd_status = ao_cmd_syntax_error;
-}
+#if BT_LINK_ON_P2
+#define BT_PICTL_ICON PICTL_P2ICON
+#define BT_PIFG P2IFG
+#define BT_PDIR P2DIR
+#define BT_PINP P2INP
+#define BT_IEN2_PIE IEN2_P2IE
+#endif
+#if BT_LINK_ON_P1
+#define BT_PICTL_ICON PICTL_P1ICON
+#define BT_PIFG P1IFG
+#define BT_PDIR P1DIR
+#define BT_PINP P1INP
+#define BT_IEN2_PIE IEN2_P1IE
+#endif