Commit 8dcc9c21 authored by 时昊's avatar 时昊

Merge branch 'httpserver' into 'shihao_esp32'

feat:升级时才开wifi

See merge request !2
parents fd0f5d14 1a023499
...@@ -273,7 +273,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板 ...@@ -273,7 +273,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
{ {
Wifi_OTA_Request = 1; Wifi_OTA_Request = 1;
printf("收到进入OTA指令 \r\n"); printf("收到进入OTA指令 \r\n");
SwitchMode=1; SwitchMode=0x5AA57AA7;
wifiServiceStart(); wifiServiceStart();
} }
// } // }
......
...@@ -42,9 +42,10 @@ uint32_t Sys_1ms_Cnt; ...@@ -42,9 +42,10 @@ uint32_t Sys_1ms_Cnt;
#define SYS_RUN_TASK_1000MS (Sys_1ms_Cnt % 1000 == 5) #define SYS_RUN_TASK_1000MS (Sys_1ms_Cnt % 1000 == 5)
uint32_t testcnt; uint32_t testcnt;
TaskHandle_t wifi_service_hdl=NULL;
extern void Upgrade_BAT32A239_Task(void *arg);
void wifi_service_task(void *arg);
extern uint32_t SwitchMode; extern uint32_t SwitchMode;
static void Sys_Run_Tasks(void *arg) static void Sys_Run_Tasks(void *arg)
{ {
...@@ -53,6 +54,8 @@ static void Sys_Run_Tasks(void *arg) ...@@ -53,6 +54,8 @@ static void Sys_Run_Tasks(void *arg)
{ {
if(SwitchMode!=0) if(SwitchMode!=0)
{ {
xTaskCreatePinnedToCore(wifi_service_task, "wifi_service_task", 4096, NULL, 5, &wifi_service_hdl, 1);
xTaskCreatePinnedToCore(Upgrade_BAT32A239_Task, "Upgrade_BAT32A239_Task", 1024 * 4, NULL, 5, NULL, 1);
break; break;
} }
if(Sys_1ms_Cnt < 499) if(Sys_1ms_Cnt < 499)
...@@ -128,11 +131,9 @@ static void Sys_Run_Tasks(void *arg) ...@@ -128,11 +131,9 @@ static void Sys_Run_Tasks(void *arg)
vTaskDelete(NULL); vTaskDelete(NULL);
} }
TaskHandle_t wifi_service_hdl=NULL;
extern uint32_t SwitchMode;
extern void wifiServiceStart(void); void wifi_service_task(void *arg)
extern void Upgrade_BAT32A239_Task(void *arg);
static void wifi_service_task(void *arg)
{ {
while (1) while (1)
{ {
...@@ -161,8 +162,8 @@ void app_main(void) ...@@ -161,8 +162,8 @@ void app_main(void)
printf("KL30 INIT OVER~~~~~~\r\n"); printf("KL30 INIT OVER~~~~~~\r\n");
xTaskCreatePinnedToCore(Sys_Run_Tasks, "Sys_Run_Tasks", 4096, NULL, 3, Sys_Run_Taskshdl, 1); xTaskCreatePinnedToCore(Sys_Run_Tasks, "Sys_Run_Tasks", 4096, NULL, 3, Sys_Run_Taskshdl, 1);
xTaskCreatePinnedToCore(wifi_service_task, "wifi_service_task", 4096, NULL, 5, &wifi_service_hdl, 1); //xTaskCreatePinnedToCore(wifi_service_task, "wifi_service_task", 4096, NULL, 5, &wifi_service_hdl, 1);
xTaskCreatePinnedToCore(Upgrade_BAT32A239_Task, "Upgrade_BAT32A239_Task", 1024 * 4, NULL, 5, NULL, 1); //xTaskCreatePinnedToCore(Upgrade_BAT32A239_Task, "Upgrade_BAT32A239_Task", 1024 * 4, NULL, 5, NULL, 1);
} }
......
...@@ -701,6 +701,8 @@ CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 ...@@ -701,6 +701,8 @@ CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20
CONFIG_BTDM_RESERVE_DRAM=0xdb5c CONFIG_BTDM_RESERVE_DRAM=0xdb5c
CONFIG_BTDM_CTRL_HLI=y CONFIG_BTDM_CTRL_HLI=y
# end of Controller Options # end of Controller Options
# CONFIG_BT_HCI_LOG_DEBUG_EN is not set
# end of Bluetooth # end of Bluetooth
# CONFIG_BLE_MESH is not set # CONFIG_BLE_MESH is not set
......
...@@ -120,7 +120,7 @@ void wifi_service(void) ...@@ -120,7 +120,7 @@ void wifi_service(void)
void wifiServiceStart(void) void wifiServiceStart(void)
{ {
if(wifi_service_info.status == WIFI_SERVICE_STOP) //if(wifi_service_info.status == WIFI_SERVICE_STOP)
{ {
// 开启WiFi服务 // 开启WiFi服务
wifi_service_info.status = WIFI_SERVICE_INIT; wifi_service_info.status = WIFI_SERVICE_INIT;
......
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