Commit 40545edd authored by 薛小虎's avatar 薛小虎

fix: 修改自动重连函数,解决内存泄漏问题;修改为每30s自动重连一次

parent 1a210b50
......@@ -11,13 +11,13 @@ extern esp_bd_addr_t peer_addr;
BT_User_Control_Struct BT_User;
#define BT_ReConn_T 3000
#define BT_ReConn_T 300
void BT_User_Init(void )
{
BT_User.BT_Sts = BT_Idle;
BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.ReconnTime = BT_ReConn_T - 50;
BT_User.HF_Ctrl = HF_Idle;
}
......@@ -26,7 +26,7 @@ void BT_Connect_Event_Pro(void )
{
BT_User.BT_Sts = BT_Conn;
BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.ReconnTime = BT_ReConn_T - 50;
BT_User.HF_Ctrl = HF_Idle;
// printf("TB CONN\r\n");
}
......@@ -36,7 +36,7 @@ void BT_DisConnect_Event_Pro(void )
{
BT_User.BT_Sts = BT_Idle;
BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.ReconnTime = BT_ReConn_T - 50;
BT_User.HF_Ctrl = HF_Idle;
// printf("TB DISCONN\r\n");
}
......
......@@ -56,6 +56,11 @@ uint8_t app_BT_Get_BondDev(void )
}
}
if(dev_list != NULL)
{
free(dev_list);
}
ret = 1;
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment