summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbtif/src/btif_core.c9
-rw-r--r--main/bte_main.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 19f26aa..47d09f2 100755
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -281,12 +281,12 @@ static void btif_task(UINT32 params)
GKI_task_self_cleanup(BTIF_TASK);
+ bte_main_shutdown();
+
if (btif_shutdown_pending)
{
btif_shutdown_pending = 0;
- bte_main_shutdown();
-
/* shutdown complete, all events notified and we reset HAL callbacks */
bt_hal_cbacks = NULL;
}
@@ -369,6 +369,9 @@ bt_status_t btif_enable_bluetooth(void)
LOGI("btif_enable_bluetooth");
+ /* initialize OS */
+ GKI_init();
+
if (btif_enabled == 1)
{
LOGD("already enabled\n");
@@ -447,7 +450,6 @@ void btif_enable_bluetooth_evt(tBTA_STATUS status, BD_ADDR local_bd)
** Returns void
**
*******************************************************************************/
-
bt_status_t btif_disable_bluetooth(void)
{
tBTA_STATUS status;
@@ -459,7 +461,6 @@ bt_status_t btif_disable_bluetooth(void)
}
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
-
//cleanup rfcomm & l2cap api
btif_sock_cleanup();
status = BTA_DisableBluetooth();
diff --git a/main/bte_main.c b/main/bte_main.c
index 7707d48..3cf6a96 100644
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -143,9 +143,6 @@ void bte_main_in_hw_init(void)
******************************************************************************/
void bte_main_boot_entry(void)
{
- /* initialize OS */
- GKI_init();
-
bte_main_in_hw_init();
bte_load_conf(BTE_STACK_CONF_FILE);
@@ -173,7 +170,7 @@ void bte_main_shutdown()
bt_vendor_if->cleanup();
#endif
- bt_vendor_if = NULL;
+ //bt_vendor_if = NULL;
GKI_shutdown();
}