releasev1.2

This commit is contained in:
kirl committed 2026-08-03 04:09:26 +08:00
1 parent 74010ef611
commit c296caa328
10 files changed
+693 -267

No files matched your search

+3 -1
View File
@@ -55,8 +55,10 @@ Cycle = { cycle_id: uint16, frag_count: uint8 (2~4), fragments: Fragment[]
| 命令 | 值 | 方向 | 说明 |
|------|-----|------|------|
| `CYCLE_DATA` | `0x01` | MPU → MCU | 下发 Cycle 数据 |
| `CYCLE_DONE` | `0x02` | MCU → MPU | Cycle 执行完成 |
| `CYCLE_DONE` | `0x02` | MCU → MPU | Cycle 执行完成 (MPU 同时终止任务计时) |
| `CYCLE_REQUEST` | `0x03` | MCU → MPU | 请求下一个 Cycle |
| `RECOGNIZE` | `0x04` | MCU → MPU | 触发视觉识别 |
| `TASK_START` | `0x05` | MCU → MPU | 任务开始 (按钮按下即发, 与 RECOGNIZE 区分; MPU 据此开始计时) |
| `ACK` | `0x80` | 双向 | 通用应答 (预留) |
| `NACK` | `0xFF` | 双向 | 错误 (预留) |
+8
View File
@@ -460,6 +460,14 @@ void edc_proto_send_recognize(void)
ESP_LOGI(TAG, "RECOGNIZE sent");
}
void edc_proto_send_task_start(void)
{
if (!s_uart_enabled) return;
uart_send_frame(EDC_CMD_TASK_START, NULL, 0);
s_stat.request_sent++;
ESP_LOGI(TAG, "TASK_START sent");
}
/* ================================================================
* 统计
* ================================================================ */
+7
View File
@@ -77,6 +77,7 @@ typedef enum {
EDC_CMD_CYCLE_DONE = 0x02, /* MCU → MPU: Cycle 执行完成 */
EDC_CMD_CYCLE_REQUEST = 0x03, /* MCU → MPU: 请求下一个 Cycle */
EDC_CMD_RECOGNIZE = 0x04, /* MCU → MPU: 触发视觉识别 */
EDC_CMD_TASK_START = 0x05, /* MCU → MPU: 任务开始 (按钮按下即发, 与 RECOGNIZE 区分) */
EDC_CMD_ACK = 0x80, /* 通用应答 */
EDC_CMD_NACK = 0xFF, /* 错误 */
} edc_cmd_t;
@@ -215,6 +216,12 @@ void edc_proto_send_request(void);
*/
void edc_proto_send_recognize(void);
/**
* @brief 发送 TASK_START 通知 MPU 任务开始计时 (通过 UART, 按钮按下即发,
* 与 RECOGNIZE 区分, 不触发识别)
*/
void edc_proto_send_task_start(void);
/**
* @brief 获取统计信息
*/