增加收到USB设置的定时配置之后通过BLE发送一次出去

This commit is contained in:
2026-08-01 11:27:12 +08:00
parent 8b39f9c48d
commit 65af06eed9
17 changed files with 1677 additions and 1663 deletions
+1 -1
View File
@@ -135271,7 +135271,7 @@
"icsd_adt_app.h"
"debug.h"
1785135433 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\default_event_handler.c
1785497222 source:d:\jianbao\project\À¶ÑÀת½Ó°å-¶ºÃ¨°ô\sdk\apps\earphone\default_event_handler.c
"default_event_handler.h"
"app_action.h"
"bt_background.h"
+1188 -1188
View File
File diff suppressed because it is too large Load Diff
+21 -6
View File
@@ -10,6 +10,7 @@
* - V1.1.1, 2026.07.30, cyWu, 修复设置后立即发送导致栈溢出复位
* - V1.2.0, 2026.07.30, cyWu, USB 连接时暂停定时发送
* - V1.2.1, 2026.07.30, cyWu, 改为 COM(DTR) 开闭控制暂停/恢复
* - V1.2.2, 2026.08.01, cyWu, 设置后立即验发不受 COM 暂停限制
*
* USB 设置帧 payloadCMD=0x70)格式:
* [0] slot 槽位 0~9
@@ -362,14 +363,26 @@ static void dengle_send_bytes(const DengleSlot_t *slot)
}
}
static void dengle_send_slot(const DengleSlot_t *slot)
/**
* @brief 发送指定槽位
* @param slot 槽位
* @param ignore_pause 1=配置验发,忽略 COM 暂停;0=周期发送,COM 开则跳过
*/
static void dengle_send_slot(const DengleSlot_t *slot, uint8_t ignore_pause)
{
if (!slot || !slot->enable || slot->data_n == 0) {
return;
}
/* USB 连着电脑时不发,避免配置阶段干扰 */
if (dengle_is_usb_pause()) {
/* 周期发送:COM 打开时暂停;设置后验发不受此限制 */
if (!ignore_pause && dengle_is_usb_pause()) {
return;
}
if (usr_get_conn_service() == 0) {
if (ignore_pause) {
printf("dengle verify skip: BLE not connected\n");
}
return;
}
@@ -381,7 +394,8 @@ static void dengle_send_slot(const DengleSlot_t *slot)
}
/**
* @brief 延时立即发:与 USB 解析/ACK 错开,降低栈峰值
* @brief 延时立即发:与 USB 解析/ACK 错开,降低栈峰值
* @note 即使 COM 打开也发一次,方便设置时确认 BLE 是否收到
*/
static void dengle_imm_send_timeout(void *priv)
{
@@ -389,7 +403,8 @@ static void dengle_imm_send_timeout(void *priv)
s_imm_send_timer = 0;
if (slot_id < DENGLE_SLOT_MAX) {
dengle_send_slot(&s_slots[slot_id]);
printf("dengle imm verify send slot=%u\n", slot_id);
dengle_send_slot(&s_slots[slot_id], 1);
}
}
@@ -441,7 +456,7 @@ static void dengle_tick(void *priv)
slot->elapsed_ms += DENGLE_TICK_MS;
if (slot->elapsed_ms >= slot->period_ms) {
slot->elapsed_ms = 0;
dengle_send_slot(slot);
dengle_send_slot(slot, 0);
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+467 -468
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.