From 91d9d9a4b0d79ab0bb60a50ee19993696f758c38 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 30 Aug 2025 11:42:43 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3fd230=20=E7=9A=84650=E4=B9=98?= =?utf8?q?=E8=BD=A6=E7=A0=81=E4=B8=8D=E8=83=BD=E8=8E=B7=E5=8F=96=E9=97=AE?= =?utf8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../config/target_config/brandy/config.py | 4 ++-- .../ble_service/transspecard/transspecard.c | 18 +++++++++++------- .../factorytest_service/factorytest_protocol.c | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 6a084ed30..366c61cc3 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -409,7 +409,7 @@ target = { 'NANDFLASH_DS35X', 'BLE_INSTRUCT', # 'AILPAY_SUPPORT', - # 'SUPPORT_FACTORY_SERVICE', + 'SUPPORT_FACTORY_SERVICE', # 'MEMORY_CORRUPTION', ], @@ -421,7 +421,6 @@ target = { "ppg_sensor_hx3695", # "ppgBleService", "mag_sensor_mmc5603", - "thunderbird_toys",#雷鸟 "vibrator", "vibrator_service", # "-:lwip", @@ -1140,6 +1139,7 @@ target = { "vibrator", "vibrator_service", # "-:lwip", + "thunderbird_toys",#雷鸟 "cat1Service", "cat1Test", "audio_manager", diff --git a/code/sdk/zhihui/services/ble_service/transspecard/transspecard.c b/code/sdk/zhihui/services/ble_service/transspecard/transspecard.c index 4b8d7dc9e..b8dda87bb 100644 --- a/code/sdk/zhihui/services/ble_service/transspecard/transspecard.c +++ b/code/sdk/zhihui/services/ble_service/transspecard/transspecard.c @@ -9,8 +9,6 @@ #endif #include #include -#include -#include #define alipay_transspecard_log 0 // 用于日志打印 #define ALIPAY_TRANSSPECARD_ERRCODE_SUCC 0 @@ -242,7 +240,7 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen) { send_packet_total++; } - + printf("get_alipay_ble_nus_max_data_len: %u\r\n",get_alipay_ble_nus_max_data_len()); printf("总数据长度: %u 字节, 预计分包数量: %u 个\n", datalen, send_packet_total); // 单包传输逻辑 @@ -271,10 +269,14 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen) // 多包传输逻辑 uint8_t current_packet = 1; int all_packets_sent = 0; - // 初始化信号量 + if(g_transspecard_ack_sem != NULL) + { + osSemaphoreDelete(g_transspecard_ack_sem); + g_transspecard_ack_sem = NULL; + } if (g_transspecard_ack_sem == NULL) { - g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL); + g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL);// 初始化信号量 } // 先顺序发送所有数据包 @@ -470,7 +472,7 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen) #endif // 接收缓冲区最大长度 -#define MAX_RECEIVE_BUFFER_SIZE (1024 * 4) // +#define MAX_RECEIVE_BUFFER_SIZE (1024 * 5) // #define RECEIVE_PACKET_FIRST 0x01 // 第一个包 #define RECEVIE_PACKET_COMPLETED_ACK 0x00 // 最后一个包接收完成ACK #define RECEIVE_PACKET_HEADER 0x73 // 消息头 @@ -634,14 +636,16 @@ uint8_t parse_transspecard_data(void *buf, uint16_t event_size) receive_packet_total = current_packet_total; receive_total_datalen = current_total_datalen; + #if 0 if (receive_total_datalen > MAX_RECEIVE_BUFFER_SIZE) { - printf("Received data length exceeds buffer size!\r\n"); + printf("Received data length exceeds buffer size,receive_total_datalen:%u!\r\n",receive_total_datalen); isProcessingData = 0; ble_transspecard_receive_cleanup_resources(); notify_resend(RECEIVE_PACKET_FIRST); return ALIPAY_TRANSSPECARD_ERRCODE_FAIL; } + #endif packet_received_flags = (uint8_t *)malloc(receive_packet_total); if (packet_received_flags == NULL) diff --git a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c index a2d6c950d..951565b8a 100644 --- a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c +++ b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c @@ -1364,7 +1364,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //获取原始数据 int16_t x,y; #ifdef TPTYPE_FT6X46 - get_tp_info(&x,&y); + // get_tp_info(&x,&y); #endif uint8_t databuf[5] = {0}; -- 2.17.1