Commit 90ec0dd3 authored by 薛晓虎's avatar 薛晓虎

feat: 添加蓝牙内部版本号与底板交互

parent 50382e07
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "main_user.h"
#define TAG "Prot_User" #define TAG "Prot_User"
...@@ -251,6 +253,8 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData) ...@@ -251,6 +253,8 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
{ {
bsp_Ble_Init(); bsp_Ble_Init();
SW_Send_Cnt_Set(150);
// printf("get uuid and init ble!!! \r\n"); // printf("get uuid and init ble!!! \r\n");
} }
...@@ -377,7 +381,21 @@ void Uart_Send_Id02_Pro(void) ...@@ -377,7 +381,21 @@ void Uart_Send_Id02_Pro(void)
} }
void Uart_Send_Id13(void)
{
uint8_t wtemp[3] = {0};
wtemp[0] = BL_INTERNAL_SW_YEAR;
wtemp[1] = BL_INTERNAL_SW_MONTH;
wtemp[2] = BL_INTERNAL_SW_DAY;
Protocol_Send(0x13, wtemp, 3);
}
uint16_t SW_Send_Cnt = 0;
void SW_Send_Cnt_Set(uint16_t val)
{
SW_Send_Cnt = val;
}
void Prot_Send_Msg_Process(void ) void Prot_Send_Msg_Process(void )
{ {
...@@ -403,5 +421,12 @@ void Prot_Send_Msg_Process(void ) ...@@ -403,5 +421,12 @@ void Prot_Send_Msg_Process(void )
Prot_User.TimeDelay = 0; Prot_User.TimeDelay = 0;
//printf("send 0x01 0x02 \r\n"); //printf("send 0x01 0x02 \r\n");
} }
SW_Send_Cnt++;
if(SW_Send_Cnt >= 200)
{
Uart_Send_Id13();
SW_Send_Cnt = 0;
}
} }
} }
...@@ -39,4 +39,7 @@ void Prot_Send_Msg_Process(void ); ...@@ -39,4 +39,7 @@ void Prot_Send_Msg_Process(void );
void Uart_Send_Id12_Pro(void ); void Uart_Send_Id12_Pro(void );
void SW_Send_Cnt_Set(uint16_t val);
#endif #endif
...@@ -621,6 +621,7 @@ void Ble_DisConnect_Event_Pro(void ) ...@@ -621,6 +621,7 @@ void Ble_DisConnect_Event_Pro(void )
Ble_Clear_Rx_Buffer(); Ble_Clear_Rx_Buffer();
BleTime.TimeReqCnt = 0; BleTime.TimeReqCnt = 0;
} }
......
...@@ -138,7 +138,7 @@ void app_main(void) ...@@ -138,7 +138,7 @@ void app_main(void)
bsp_Uart_Init(); bsp_Uart_Init();
// printf("KL30 INIT OVER~~~~~~\r\n"); // printf("KL30 INIT OVER~~~~~~\r\n");
ESP_LOGE("MAIN", "Internal Sw = %f", Inter_SW); // ESP_LOGE("MAIN", "Internal Sw = %f", Inter_SW);
xTaskCreatePinnedToCore(Sys_Run_Tasks, "Sys_Run_Tasks", 4096, NULL, 3, NULL, 1); xTaskCreatePinnedToCore(Sys_Run_Tasks, "Sys_Run_Tasks", 4096, NULL, 3, NULL, 1);
} }
......
#ifndef _MAIN_USER_H_ #ifndef _MAIN_USER_H_
#define _MAIN_USER_H_ #define _MAIN_USER_H_
#define BL_INTERNAL_SW_YEAR 24
#define BL_INTERNAL_SW_MONTH 7
#define BL_INTERNAL_SW_DAY 18
#endif #endif
\ No newline at end of file
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