Commit f4f42f36 authored by 时昊's avatar 时昊

feat:屏蔽printf

parent 896a06f4
...@@ -221,7 +221,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板 ...@@ -221,7 +221,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
if(Prot_User.State < Prot_Start) if(Prot_User.State < Prot_Start)
{ {
Prot_User.State = Prot_Start; Prot_User.State = Prot_Start;
printf("Prot_Start \r\n"); //printf("Prot_Start \r\n");
} }
} }
else if(pData->CmdID == 0x03 )//收到底板发送的电话状态,来控制esp32蓝牙电话 else if(pData->CmdID == 0x03 )//收到底板发送的电话状态,来控制esp32蓝牙电话
...@@ -231,7 +231,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板 ...@@ -231,7 +231,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
{ {
Prot_User.State = Prot_Normal; Prot_User.State = Prot_Normal;
printf("Prot_Normal \r\n"); //printf("Prot_Normal \r\n");
} }
if(Prot_User.State >= Prot_Start) if(Prot_User.State >= Prot_Start)
......
...@@ -28,7 +28,7 @@ void BT_Connect_Event_Pro(void ) ...@@ -28,7 +28,7 @@ void BT_Connect_Event_Pro(void )
BT_User.Call_Sts = Call_Idle; BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500; BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.HF_Ctrl = HF_Idle; BT_User.HF_Ctrl = HF_Idle;
printf("TB CONN\r\n"); //printf("TB CONN\r\n");
} }
...@@ -38,7 +38,7 @@ void BT_DisConnect_Event_Pro(void ) ...@@ -38,7 +38,7 @@ void BT_DisConnect_Event_Pro(void )
BT_User.Call_Sts = Call_Idle; BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500; BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.HF_Ctrl = HF_Idle; BT_User.HF_Ctrl = HF_Idle;
printf("TB DISCONN\r\n"); //printf("TB DISCONN\r\n");
} }
void BT_User_Process(void ) void BT_User_Process(void )
...@@ -88,13 +88,13 @@ void BT_User_Process(void ) ...@@ -88,13 +88,13 @@ void BT_User_Process(void )
BT_User.ReconnTime++; BT_User.ReconnTime++;
if(BT_User.ReconnTime >= BT_ReConn_T) if(BT_User.ReconnTime >= BT_ReConn_T)
{ {
printf("Connect Start.................\n"); //printf("Connect Start.................\n");
if(app_BT_Get_BondDev() == 1) if(app_BT_Get_BondDev() == 1)
{ {
esp_hf_client_connect(peer_addr); esp_hf_client_connect(peer_addr);
} }
printf("Connect Over\n"); //printf("Connect Over\n");
BT_User.ReconnTime = 0; BT_User.ReconnTime = 0;
} }
......
...@@ -339,12 +339,12 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -339,12 +339,12 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
{ {
BT_User.Call_Sts = Call_Idle;//电话空闲 BT_User.Call_Sts = Call_Idle;//电话空闲
printf("call idle\r\n"); //printf("call idle\r\n");
} }
else if(param->call.status == 1) else if(param->call.status == 1)
{ {
BT_User.Call_Sts = Call_InProcess;//正在接电话 BT_User.Call_Sts = Call_InProcess;//正在接电话
printf("call Call_InProcess\r\n"); //printf("call Call_InProcess\r\n");
} }
break; break;
} }
...@@ -362,7 +362,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -362,7 +362,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
{ {
BT_User.Call_Sts = Call_Idle; BT_User.Call_Sts = Call_Idle;
printf("call idle\r\n"); //printf("call idle\r\n");
} }
break; break;
} }
...@@ -370,19 +370,19 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -370,19 +370,19 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
{ {
BT_User.Call_Sts = Call_IncomeCalling; BT_User.Call_Sts = Call_IncomeCalling;
printf("call income\r\n"); //printf("call income\r\n");
break; break;
} }
case 2: case 2:
{ {
BT_User.Call_Sts = Call_OutCalling; BT_User.Call_Sts = Call_OutCalling;
printf("call outcall\r\n"); //printf("call outcall\r\n");
break; break;
} }
case 3: case 3:
{ {
BT_User.Call_Sts = Call_OutCalling; BT_User.Call_Sts = Call_OutCalling;
printf("call outcall\r\n"); //printf("call outcall\r\n");
break; break;
} }
} }
...@@ -517,42 +517,42 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -517,42 +517,42 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
HF_CMD_HANDLER(conn) HF_CMD_HANDLER(conn)
{ {
printf("connect\n"); //printf("connect\n");
esp_hf_client_connect(peer_addr); esp_hf_client_connect(peer_addr);
return 0; return 0;
} }
HF_CMD_HANDLER(disc) HF_CMD_HANDLER(disc)
{ {
printf("disconnect\n"); //printf("disconnect\n");
esp_hf_client_disconnect(peer_addr); esp_hf_client_disconnect(peer_addr);
return 0; return 0;
} }
HF_CMD_HANDLER(conn_audio) HF_CMD_HANDLER(conn_audio)
{ {
printf("connect audio\n"); //printf("connect audio\n");
esp_hf_client_connect_audio(peer_addr); esp_hf_client_connect_audio(peer_addr);
return 0; return 0;
} }
HF_CMD_HANDLER(disc_audio) HF_CMD_HANDLER(disc_audio)
{ {
printf("disconnect audio\n"); //printf("disconnect audio\n");
esp_hf_client_disconnect_audio(peer_addr); esp_hf_client_disconnect_audio(peer_addr);
return 0; return 0;
} }
HF_CMD_HANDLER(query_op) HF_CMD_HANDLER(query_op)
{ {
printf("Query operator\n"); //printf("Query operator\n");
esp_hf_client_query_current_operator_name(); esp_hf_client_query_current_operator_name();
return 0; return 0;
} }
HF_CMD_HANDLER(answer) HF_CMD_HANDLER(answer)
{ {
printf("Answer call\n"); //printf("Answer call\n");
esp_hf_client_answer_call(); esp_hf_client_answer_call();
return 0; return 0;
} }
...@@ -560,21 +560,21 @@ HF_CMD_HANDLER(reject) ...@@ -560,21 +560,21 @@ HF_CMD_HANDLER(reject)
{ {
esp_err_t err; esp_err_t err;
err = esp_hf_client_reject_call(); err = esp_hf_client_reject_call();
printf("Reject call err %d\n",err); //printf("Reject call err %d\n",err);
return 0; return 0;
} }
const char test_dial_num[] = "17800536969"; const char test_dial_num[] = "17800536969";
HF_CMD_HANDLER(dial) HF_CMD_HANDLER(dial)
{ {
printf("Dial number %s\n", test_dial_num); //printf("Dial number %s\n", test_dial_num);
esp_hf_client_dial(test_dial_num); esp_hf_client_dial(test_dial_num);
return 0; return 0;
} }
HF_CMD_HANDLER(redial) HF_CMD_HANDLER(redial)
{ {
printf("Dial number\n"); //printf("Dial number\n");
esp_hf_client_dial(NULL); esp_hf_client_dial(NULL);
return 0; return 0;
} }
...@@ -589,14 +589,14 @@ HF_CMD_HANDLER(dial_mem) ...@@ -589,14 +589,14 @@ HF_CMD_HANDLER(dial_mem)
HF_CMD_HANDLER(start_vr) HF_CMD_HANDLER(start_vr)
{ {
printf("Start voice recognition\n"); //printf("Start voice recognition\n");
esp_hf_client_start_voice_recognition(); esp_hf_client_start_voice_recognition();
return 0; return 0;
} }
HF_CMD_HANDLER(stop_vr) HF_CMD_HANDLER(stop_vr)
{ {
printf("Stop voice recognition\n"); //printf("Stop voice recognition\n");
esp_hf_client_stop_voice_recognition(); esp_hf_client_stop_voice_recognition();
return 0; return 0;
} }
...@@ -635,7 +635,7 @@ HF_CMD_HANDLER(btrh) ...@@ -635,7 +635,7 @@ HF_CMD_HANDLER(btrh)
{ {
int btrh = ESP_HF_BTRH_CMD_HOLD; int btrh = ESP_HF_BTRH_CMD_HOLD;
printf("respond and hold command: %d\n", btrh); //printf("respond and hold command: %d\n", btrh);
esp_hf_client_send_btrh_cmd(btrh); esp_hf_client_send_btrh_cmd(btrh);
return 0; return 0;
} }
......
...@@ -515,7 +515,7 @@ int bsp_Ble_Gatts_Send_Indicate( uint8_t len, uint8_t *data) ...@@ -515,7 +515,7 @@ int bsp_Ble_Gatts_Send_Indicate( uint8_t len, uint8_t *data)
if(err != ESP_OK) if(err != ESP_OK)
{ {
printf("ble trans fail!!\r\n"); //printf("ble trans fail!!\r\n");
} }
} }
...@@ -534,7 +534,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param ...@@ -534,7 +534,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param
if (adv_config_done == 0){ if (adv_config_done == 0){
esp_ble_gap_start_advertising(&adv_params); esp_ble_gap_start_advertising(&adv_params);
printf("adv 1\r\n"); //printf("adv 1\r\n");
} }
break; break;
case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT:
...@@ -542,7 +542,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param ...@@ -542,7 +542,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param
if (adv_config_done == 0){ if (adv_config_done == 0){
esp_ble_gap_start_advertising(&adv_params); esp_ble_gap_start_advertising(&adv_params);
printf("adv 2\r\n"); //printf("adv 2\r\n");
} }
break; break;
#else #else
...@@ -896,7 +896,7 @@ void Get_Mac_Init(void ) ...@@ -896,7 +896,7 @@ void Get_Mac_Init(void )
esp_read_mac(ble_mac, ESP_MAC_BT); esp_read_mac(ble_mac, ESP_MAC_BT);
sprintf(temp, "%02X%02X", ble_mac[4], ble_mac[5]); //sprintf(temp, "%02X%02X", ble_mac[4], ble_mac[5]);
raw_adv_data[sizeof(raw_adv_data) - 4] = temp[0]; raw_adv_data[sizeof(raw_adv_data) - 4] = temp[0];
raw_adv_data[sizeof(raw_adv_data) - 3] = temp[1]; raw_adv_data[sizeof(raw_adv_data) - 3] = temp[1];
...@@ -908,7 +908,7 @@ void Get_Mac_Init(void ) ...@@ -908,7 +908,7 @@ void Get_Mac_Init(void )
// ESP_LOGW(GATTS_TABLE_TAG, "BLE_MAC IS %s : ", // ESP_LOGW(GATTS_TABLE_TAG, "BLE_MAC IS %s : ",
// temp); // temp);
printf("My MAC:\n"); //printf("My MAC:\n");
esp_log_buffer_hex(GATTS_TABLE_TAG, ble_mac, 6); esp_log_buffer_hex(GATTS_TABLE_TAG, ble_mac, 6);
BT_Device_Name[sizeof(BT_Device_Name) - 11] = temp[0]; BT_Device_Name[sizeof(BT_Device_Name) - 11] = temp[0];
...@@ -923,7 +923,7 @@ void Get_Mac_Init(void ) ...@@ -923,7 +923,7 @@ void Get_Mac_Init(void )
raw_adv_data[15] = ble_mac[4]; raw_adv_data[15] = ble_mac[4];
raw_adv_data[16] = ble_mac[5]; raw_adv_data[16] = ble_mac[5];
sprintf(temp1, "%02X%02X%02X%02X%02X%02X", ble_mac[0], ble_mac[1], ble_mac[2], ble_mac[3], ble_mac[4], ble_mac[5]); //sprintf(temp1, "%02X%02X%02X%02X%02X%02X", ble_mac[0], ble_mac[1], ble_mac[2], ble_mac[3], ble_mac[4], ble_mac[5]);
for(int i=0; i<12; i++) for(int i=0; i<12; i++)
......
...@@ -161,7 +161,7 @@ void app_main(void) ...@@ -161,7 +161,7 @@ void app_main(void)
app_tpms_main(); app_tpms_main();
bsp_Uart_Init(); bsp_Uart_Init();
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);
......
...@@ -130,16 +130,16 @@ void simple_ota_example_task(void *pvParameter) ...@@ -130,16 +130,16 @@ void simple_ota_example_task(void *pvParameter)
if (ret == ESP_OK) { if (ret == ESP_OK) {
ESP_LOGI(TAG, "OTA Succeed"); ESP_LOGI(TAG, "OTA Succeed");
printf("\n"); //printf("\n");
printf("==========================================================\n"); //printf("==========================================================\n");
for(i = 5; i > 0; i--) for(i = 5; i > 0; i--)
{ {
printf("============ System will restart in %d second. ============\n", i); //printf("============ System will restart in %d second. ============\n", i);
vTaskDelay(1000 / portTICK_PERIOD_MS); vTaskDelay(1000 / portTICK_PERIOD_MS);
} }
printf("============ System rebooting... ============\n"); //printf("============ System rebooting... ============\n");
printf("==========================================================\n"); //printf("==========================================================\n");
printf("\n"); //printf("\n");
esp_restart(); esp_restart();
} else { } else {
...@@ -155,7 +155,7 @@ static void print_sha256(const uint8_t *image_hash, const char *label) ...@@ -155,7 +155,7 @@ static void print_sha256(const uint8_t *image_hash, const char *label)
char hash_print[HASH_LEN * 2 + 1]; char hash_print[HASH_LEN * 2 + 1];
hash_print[HASH_LEN * 2] = 0; hash_print[HASH_LEN * 2] = 0;
for (int i = 0; i < HASH_LEN; ++i) { for (int i = 0; i < HASH_LEN; ++i) {
sprintf(&hash_print[i * 2], "%02x", image_hash[i]); //sprintf(&hash_print[i * 2], "%02x", image_hash[i]);
} }
ESP_LOGI(TAG, "%s %s", label, hash_print); ESP_LOGI(TAG, "%s %s", label, hash_print);
} }
......
...@@ -83,7 +83,7 @@ void softap_service_start(void) ...@@ -83,7 +83,7 @@ void softap_service_start(void)
esp_wifi_get_mac(WIFI_IF_AP, softap_mac); esp_wifi_get_mac(WIFI_IF_AP, softap_mac);
// 将MAC地址后两个字节转为字符串 // 将MAC地址后两个字节转为字符串
char softap_temp[5]; char softap_temp[5];
sprintf(softap_temp, "%02X%02X", softap_mac[4], softap_mac[5]); //sprintf(softap_temp, "%02X%02X", softap_mac[4], softap_mac[5]);
// 将MAC地址拼接到 ESP_WIFI_SSID 后面 // 将MAC地址拼接到 ESP_WIFI_SSID 后面
char softap_ssid[32] = ESP_WIFI_SSID; char softap_ssid[32] = ESP_WIFI_SSID;
strcat(softap_ssid, softap_temp); strcat(softap_ssid, softap_temp);
......
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