|
|
@@ -35,8 +35,11 @@ int bt_stack_init(void)
|
|
|
}
|
|
|
INIT_APP_EXPORT(bt_stack_init);
|
|
|
|
|
|
-
|
|
|
+#ifdef BTSTACK_BT_UART_PORT_DEV_NAME
|
|
|
+#define SAMPLE_UART_NAME BTSTACK_BT_UART_PORT_DEV_NAME
|
|
|
+#else
|
|
|
#define SAMPLE_UART_NAME "uart3"
|
|
|
+#endif
|
|
|
|
|
|
/* ?????????? */
|
|
|
static struct rt_semaphore rx_sem;
|
|
|
@@ -84,6 +87,15 @@ static int uart_sample(int argc, char *argv[])
|
|
|
{
|
|
|
rt_strncpy(uart_name, SAMPLE_UART_NAME, RT_NAME_MAX);
|
|
|
}
|
|
|
+#ifdef BTSTACK_BT_RESET_PIN
|
|
|
+ rt_pin_mode(BTSTACK_BT_RESET_PIN, PIN_MODE_OUTPUT);
|
|
|
+
|
|
|
+ rt_pin_write(BTSTACK_BT_RESET_PIN, PIN_LOW);
|
|
|
+ HAL_Delay(1000);
|
|
|
+ rt_pin_write(BTSTACK_BT_RESET_PIN, PIN_HIGH);
|
|
|
+ HAL_Delay(1000);
|
|
|
+#else
|
|
|
+#ifdef SOC_FAMILY_STM32
|
|
|
#define BT_AP6212_PIN GET_PIN(I, 11)
|
|
|
rt_pin_mode(BT_AP6212_PIN, PIN_MODE_OUTPUT);
|
|
|
|
|
|
@@ -91,6 +103,10 @@ static int uart_sample(int argc, char *argv[])
|
|
|
HAL_Delay(1000);
|
|
|
rt_pin_write(BT_AP6212_PIN, PIN_HIGH);
|
|
|
HAL_Delay(1000);
|
|
|
+#else
|
|
|
+#error "Please set the reset pin
|
|
|
+#endif
|
|
|
+#endif
|
|
|
rt_kprintf("\r\n =====helloworld=====\r\n ");
|
|
|
/* ?????????? */
|
|
|
if(serial == NULL)
|