Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QJ_500-7c
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
QJ_500-7c
Commits
af031a30
Commit
af031a30
authored
Jul 31, 2024
by
薛小虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化wifi升级问题。蓝牙相关任务整理
parent
9ac078a8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
126 additions
and
44 deletions
+126
-44
Protocol_User.c
qianjiang/main/Protocol_User.c
+55
-20
app_Ble_User.c
qianjiang/main/app_Ble_User.c
+37
-4
app_Ble_User.h
qianjiang/main/app_Ble_User.h
+2
-0
gatts_table_creat_demo.c
qianjiang/main/gatts_table_creat_demo.c
+12
-3
gatts_table_creat_demo.h
qianjiang/main/gatts_table_creat_demo.h
+1
-1
main_user.c
qianjiang/main/main_user.c
+12
-7
main_user.h
qianjiang/main/main_user.h
+3
-3
sdkconfig
qianjiang/sdkconfig
+4
-6
No files found.
qianjiang/main/Protocol_User.c
View file @
af031a30
...
...
@@ -271,7 +271,6 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
// {
if
(
Wifi_OTA_Request
==
0
)
{
app_ble_stop
();
Wifi_OTA_Request
=
1
;
printf
(
"get ota req!
\r\n
"
);
}
...
...
@@ -400,34 +399,70 @@ void SW_Send_Cnt_Set(uint16_t val)
void
Prot_Send_Msg_Process
(
void
)
{
if
(
Prot_User
.
TimeDelay
<
4
)
{
Prot_User
.
TimeDelay
++
;
}
else
{
Prot_User
.
TimeDelay
=
0
;
}
switch
(
Prot_User
.
TimeDelay
)
{
case
0
:
{
if
(
Prot_User
.
State
<
Prot_Start
)
{
Uart_Send_Id10_Pro
();
// printf("send 0x10 \r\n");
}
if
(
Prot_User
.
State
>=
Prot_Start
)
break
;
}
case
1
:
{
if
(
Prot_User
.
TimeDelay
==
0
)
if
(
Prot_User
.
State
>=
Prot_Start
)
{
Uart_Send_Id12_Pro
();
Prot_User
.
TimeDelay
++
;
// printf("send 0x12 \r\n");
// Uart_Send_Id10_Pro();
}
else
break
;
}
case
2
:
{
if
(
Prot_User
.
State
>=
Prot_Start
)
{
Uart_Send_Id01_Pro
();
}
break
;
}
case
3
:
{
if
(
Prot_User
.
State
>=
Prot_Start
)
{
Uart_Send_Id02_Pro
();
Prot_User
.
TimeDelay
=
0
;
//printf("send 0x01 0x02 \r\n");
}
SW_Send_Cnt
++
;
break
;
}
case
4
:
{
if
(
Prot_User
.
State
>=
Prot_Start
)
{
SW_Send_Cnt
++
;
if
(
SW_Send_Cnt
>=
200
)
{
Uart_Send_Id13
();
SW_Send_Cnt
=
0
;
}
}
break
;
}
default:
{
break
;
}
}
}
qianjiang/main/app_Ble_User.c
View file @
af031a30
...
...
@@ -13,6 +13,7 @@
#include "main_user.h"
#include "esp_log.h"
#include "Protocol_User.h"
#include "bt_app_hf.h"
#define TAG "APP_BLE_USER"
...
...
@@ -22,6 +23,8 @@ app_Ble_User_Data_Union BleRecData;
app_Ble_User_Data_Union
BleTransData
;
app_Ble_Rec_Data_Ctrl_Struct
RecCtrl
;
static
uint32_t
gu8BleCycTaskCnt
;
uint8_t
Wifi_OTA_Request
=
0
;
uint8_t
ble_key
[
32
]
=
"1BJ7J8S"
;
...
...
@@ -32,6 +35,8 @@ uint8_t flavor[4] = {0x33, 0, 0, 0};
SemaphoreHandle_t
BleRecSuc_Semaphore
;
static
TaskHandle_t
gBleEventTaskHdl
=
NULL
;
...
...
@@ -625,7 +630,7 @@ void Ble_DisConnect_Event_Pro(void )
}
void
Ble_User_Task
(
void
*
pvParameter
)
void
Ble_User_Task
_Event
(
void
*
pvParameter
)
{
while
(
1
)
...
...
@@ -658,6 +663,8 @@ void Ble_User_Task(void *pvParameter)
}
}
}
ESP_LOGW
(
"ota"
,
"vtask del ble event"
);
vTaskDelete
(
NULL
);
}
...
...
@@ -665,9 +672,27 @@ void Ble_User_Task_Cyc(void *pvParameter)
{
while
(
1
)
{
if
(
gu8BleCycTaskCnt
<
9
)
{
gu8BleCycTaskCnt
++
;
}
else
{
gu8BleCycTaskCnt
=
0
;
Ble_Msg_RequestTime
();
vTaskDelay
(
1000
);
}
Get_Iphone_Fitter_callsts
();
Ble_MsgRec_Navi_Timeout
();
esp_hf_client_query_current_calls
();
if
(
Wifi_OTA_Request
!=
0
)
{
break
;
}
vTaskDelay
(
100
);
}
ESP_LOGW
(
"ota"
,
"vtask del ble cyc"
);
vTaskDelete
(
NULL
);
}
...
...
@@ -698,8 +723,16 @@ void Ble_User_Init(void )
Ble_Clear_Rx_Buffer
();
xTaskCreatePinnedToCore
(
Ble_User_Task
,
"Ble_User"
,
4096
,
NULL
,
10
,
NULL
,
0
);
xTaskCreatePinnedToCore
(
Ble_User_Task
_Event
,
"Ble_User"
,
4096
,
NULL
,
10
,
&
gBleEventTaskHdl
,
0
);
xTaskCreatePinnedToCore
(
Ble_User_Task_Cyc
,
"Ble_User_Cyc"
,
4096
,
NULL
,
9
,
NULL
,
0
);
}
void
gatts_Ble_User_Task_Event_Del
(
void
)
{
if
(
gBleEventTaskHdl
!=
NULL
)
{
vTaskDelete
(
gBleEventTaskHdl
);
}
}
qianjiang/main/app_Ble_User.h
View file @
af031a30
...
...
@@ -244,5 +244,7 @@ void Ble_MsgRec_Navi_Timeout(void );
void
Ble_Msg_RequestTime
(
void
);
app_Ble_Time_Info_Struct
*
Get_Ble_TimeInfo
(
void
);
void
gatts_Ble_User_Task_Event_Del
(
void
);
#endif
\ No newline at end of file
qianjiang/main/gatts_table_creat_demo.c
View file @
af031a30
...
...
@@ -101,8 +101,15 @@ static void Uart_Rx_Task(void *arg)
UART_Put
(
data
[
i
]);
}
}
if
(
Wifi_OTA_Request
!=
0
)
{
break
;
}
}
ESP_LOGW
(
"ota"
,
"vtask del uart rx"
);
free
(
data
);
vTaskDelete
(
NULL
);
}
void
bsp_Uart_Init
(
void
)
...
...
@@ -124,15 +131,17 @@ void simple_ota_service(void)
{
if
(
Wifi_OTA_Request
==
1
)
{
Wifi_OTA_Request
=
2
;
gatts_Ble_User_Task_Event_Del
();
vTaskDelay
(
300
);
gatts_App_Ble_DeInit
();
simple_ota_main
();
vTaskDelay
(
portMAX_DELAY
)
;
Wifi_OTA_Request
=
2
;
}
}
int
app_ble_stop
(
void
)
int
gatts_App_Ble_DeInit
(
void
)
{
esp_err_t
err
;
err
=
esp_bluedroid_disable
();
...
...
qianjiang/main/gatts_table_creat_demo.h
View file @
af031a30
...
...
@@ -80,5 +80,5 @@ extern uint8_t BT_Device_Name[14];
void
Get_Mac_Init
(
void
);
extern
int
bsp_Uart_Send_Data
(
uint8_t
*
data
,
unsigned
int
len
);
extern
uint8_t
BT_Device_Name
[
14
];
int
app_ble_stop
(
void
);
int
gatts_App_Ble_DeInit
(
void
);
#endif
\ No newline at end of file
qianjiang/main/main_user.c
View file @
af031a30
...
...
@@ -68,6 +68,8 @@ static void Sys_Run_Tasks(void *arg)
Protocol_Service
();
BT_User_Process
();
Prot_Send_Msg_Process
();
}
if
(
SYS_RUN_TASK_20MS
)
...
...
@@ -77,17 +79,12 @@ static void Sys_Run_Tasks(void *arg)
if
(
SYS_RUN_TASK_50MS
)
{
Prot_Send_Msg_Process
();
}
if
(
SYS_RUN_TASK_100MS
)
{
Get_Iphone_Fitter_callsts
();
Ble_MsgRec_Navi_Timeout
();
if
(
Wifi_OTA_Request
==
0
)
{
esp_hf_client_query_current_calls
();
}
}
if
(
SYS_RUN_TASK_1000MS
)
...
...
@@ -95,6 +92,7 @@ static void Sys_Run_Tasks(void *arg)
simple_ota_service
();
testcnt
++
;
if
(
testcnt
>=
10
)
{
...
...
@@ -125,8 +123,15 @@ static void Sys_Run_Tasks(void *arg)
}
}
if
(
Wifi_OTA_Request
==
2
)
{
break
;
}
vTaskDelay
(
1
);
}
ESP_LOGW
(
"ota"
,
"vtask del sys run"
);
vTaskDelete
(
NULL
);
}
...
...
qianjiang/main/main_user.h
View file @
af031a30
#ifndef _MAIN_USER_H_
#define _MAIN_USER_H_
#define BL_INTERNAL_SW_YEAR 24
#define BL_INTERNAL_SW_MONTH 7
#define BL_INTERNAL_SW_DAY
26
#define BL_INTERNAL_SW_YEAR
0x
24
#define BL_INTERNAL_SW_MONTH
0x0
7
#define BL_INTERNAL_SW_DAY
0x29
#endif
\ No newline at end of file
qianjiang/sdkconfig
View file @
af031a30
...
...
@@ -1335,18 +1335,16 @@ CONFIG_HEAP_TRACING_OFF=y
# Log output
#
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=
1
CONFIG_LOG_DEFAULT_LEVEL=
3
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=
1
CONFIG_LOG_MAXIMUM_LEVEL=
3
CONFIG_LOG_COLORS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment