From 524a274275ed04fa4578d88608934a35a3bc3f61 Mon Sep 17 00:00:00 2001 From: zhoujie <929834232@qq.com> Date: Sun, 15 Mar 2026 09:43:48 +0800 Subject: [PATCH] 101 --- doc/函数调用指南.md | 2 +- doc/模式配置与功能说明.md | 44 ++++++++++++++--------------- prj/TCPClient/User/FreeRTOSConfig.h | 2 +- prj/TCPClient/User/main.c | 18 ++++++------ 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/函数调用指南.md b/doc/函数调用指南.md index 6e7ea47..c15e5b4 100644 --- a/doc/函数调用指南.md +++ b/doc/函数调用指南.md @@ -233,7 +233,7 @@ void TcpLogic_InjectTestConfig(const ConfigCommon_t *common, const Config2D_t *c Config2D_t test_cfg2d; memset(&test_cfg2d, 0, sizeof(test_cfg2d)); test_cfg2d.Enabled = 1; -test_cfg2d.TriggerMode = 1; // 内部触发 +test_cfg2d.TriggerMode = 0; // 内部触发 (0=内部, 1=外部) test_cfg2d.TargetWidth = 64; test_cfg2d.TargetHeight = 64; test_cfg2d.TriggerTemperatureThreshold = 800; // 80.0°C diff --git a/doc/模式配置与功能说明.md b/doc/模式配置与功能说明.md index dd3afdc..052a9dd 100644 --- a/doc/模式配置与功能说明.md +++ b/doc/模式配置与功能说明.md @@ -182,15 +182,15 @@ task_business_entry (优先级 5, 2ms 轮询) │ ┌────────────┼────────────┐ │ TriggerMode=0 │ TriggerMode=1 - │ (外部触发) │ (内部触发) + │ (内部触发) │ (外部触发) ▼ ▼ - PA0/EXTI0 上升沿 Preprocess_CheckInternalTrigger2D() - │ │ (TriggerRoi 区域 Max/Avg > Threshold) - ▼ │ - ┌──────────────┐ │ - │ DEBOUNCE │ │ - │ DebounceMs │ │ - └──────┬───────┘ │ + Preprocess_CheckInternalTrigger2D() PA15/EXTI15 上升沿 + │ (TriggerRoi 区域 Max/Avg > Threshold) + │ │ + │ ┌──────────────┐ + │ │ DEBOUNCE │ + │ │ DebounceMs │ + │ └──────┬───────┘ │ │ └─────────┬───────────────┘ ▼ @@ -215,7 +215,7 @@ task_business_entry (优先级 5, 2ms 轮询) | 字段 | 类型 | 2D 触发中的作用 | |------|------|----------------| | `Enabled` | u8 | 1=启用 2D 管线 | -| `TriggerMode` | u8 | 0=外部(GPIO), 1=内部(温度) | +| `TriggerMode` | u8 | 0=内部(温度), 1=外部(GPIO) | | `TriggerDebounceIntervalMs` | u16 | 外部触发消抖等待 (ms) | | `TriggerDelayMs` | u16 | 触发确认后延迟采集 (ms) | | `TriggerBurstCount` | u8 | 连拍帧数 | @@ -249,16 +249,16 @@ handle_2d_trigger() → start_2d_burst() └──────┬──────┘ │ ┌────────────┼────────────┐ - │ TriggerType=0 │ TriggerType=1 - │ (外部触发) │ (内部触发) + │ TriggerType=1 │ TriggerType=2 + │ (内部触发) │ (外部触发) ▼ ▼ - PA0/EXTI0 上升沿 前置环形缓冲(3样本) - │ 连续3个 ≥ TriggerTempLimit - ▼ │ - ┌───────────────┐ │ - │ S1D_DEBOUNCE │ │ - │ HighTimerLimit │ │ - └──────┬────────┘ │ + 前置环形缓冲(3样本) PA15/EXTI15 上升沿 + 连续3个 ≥ TriggerTempLimit │ + │ ▼ + │ ┌───────────────┐ + │ │ S1D_DEBOUNCE │ + │ │ HighTimerLimit │ + │ └──────┬────────┘ │ │ └─────────┬───────────────┘ ▼ @@ -300,8 +300,8 @@ handle_2d_trigger() → start_2d_burst() | 字段 | 类型 | 1D 采集中的作用 | |------|------|----------------| | `Enabled` | u8 | 1=启用 1D 管线 | -| `RunMode` | u8 | 0=STOP, 1=RUN | -| `TriggerType` | u8 | 0=外部(GPIO), 1=内部(温度) | +| `RunMode` | u8 | 0=STOP, 1=RUN, 2=NOP, 3=DEBUG | +| `TriggerType` | u8 | 1=内部(温度), 2=外部(GPIO) | | `BufferSize` | u16 | 单次采集最大样本数(停止条件) | | `TriggerTempLimit` | i16 | 触发/采集温度阈值 (0.1°C/LSB) | | `HighTimerLimit` | u16 | 外部触发消抖时间 (ms) | @@ -361,7 +361,7 @@ TEMP_REQ 是服务器主动请求的按需截图通道,与自主触发管线 ``` Config2D: Enabled = 1 # 自动启用 2D 管线 - TriggerMode = 1 # 内部触发(温度检测) + TriggerMode = 0 # 内部触发(温度检测) TargetWidth = 64 # 预处理输出 64×64 TargetHeight = 64 TriggerRoiX/Y = 0, 0 # 全幅扫描 @@ -530,7 +530,7 @@ task_business_entry (优先级 5) | Height | 6 | u16 LE | 设备分辨率高度(仅标记) | | **TargetWidth** | **23** | **u16 LE** | **预处理输出宽度** | | **TargetHeight** | **25** | **u16 LE** | **预处理输出高度** | -| TriggerMode | 21 | u8 | 0=外部, 1=内部 | +| TriggerMode | 21 | u8 | 0=内部, 1=外部 | | TriggerCondition | 37 | u8 | 0=平均, 1=最大 | | TriggerTemperatureThreshold | 28 | i16 LE | 触发阈值 (0.1°C/LSB) | | TriggerBurstCount | 30 | u8 | 连拍帧数 | diff --git a/prj/TCPClient/User/FreeRTOSConfig.h b/prj/TCPClient/User/FreeRTOSConfig.h index a28b65a..3c74007 100644 --- a/prj/TCPClient/User/FreeRTOSConfig.h +++ b/prj/TCPClient/User/FreeRTOSConfig.h @@ -97,7 +97,7 @@ #define configTICK_RATE_HZ ( ( TickType_t ) 500 ) #define configMAX_PRIORITIES ( 15 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 12 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 diff --git a/prj/TCPClient/User/main.c b/prj/TCPClient/User/main.c index c57f835..aff5f5e 100644 --- a/prj/TCPClient/User/main.c +++ b/prj/TCPClient/User/main.c @@ -699,8 +699,8 @@ static void handle_2d_trigger(const RawImageBuffer_t *raw, const Config2D_t *t2, } /* Phase 4: check for new trigger */ - if (t2->TriggerMode == 0) { - /* --- External trigger --- */ + if (t2->TriggerMode == 1) { + /* --- External trigger (TriggerMode=1) --- */ if (g_ext_trigger_flag) { g_ext_trigger_flag = 0; DBG_TRIG("2D ext trigger\r\n"); @@ -715,7 +715,7 @@ static void handle_2d_trigger(const RawImageBuffer_t *raw, const Config2D_t *t2, } } } else { - /* --- Internal trigger: temperature threshold in TriggerRoi --- */ + /* --- Internal trigger (TriggerMode=0): temperature threshold in TriggerRoi --- */ if (Preprocess_CheckInternalTrigger2D(raw) == 1) { DBG_TRIG("2D internal trigger\r\n"); if (t2->TriggerDelayMs > 0) { @@ -747,8 +747,8 @@ static void handle_1d_trigger(const RawImageBuffer_t *raw, const Config1D_t *t1, switch (s1d_state) { case S1D_IDLE: - if (t1->TriggerType == 0) { - /* --- External trigger --- */ + if (t1->TriggerType == 2) { + /* --- External trigger (TriggerType=2) --- */ if (g_ext_trigger_flag) { g_ext_trigger_flag = 0; s1d_debounce_until = sys_tick_ms + t1->HighTimerLimit; @@ -756,8 +756,8 @@ static void handle_1d_trigger(const RawImageBuffer_t *raw, const Config1D_t *t1, DBG_TRIG("1D: ext trigger -> debounce %d ms\r\n", (int)t1->HighTimerLimit); } - } else { - /* --- Internal trigger: scan with pre-ring buffer --- */ + } else if (t1->TriggerType == 1) { + /* --- Internal trigger (TriggerType=1): scan with pre-ring buffer --- */ s1d_pre_ring[s1d_pre_idx] = sample; s1d_pre_idx = (s1d_pre_idx + 1) % 3; if (s1d_pre_count < 3) s1d_pre_count++; @@ -996,8 +996,8 @@ int main(void) { Config2D_t test_cfg2d; memset(&test_cfg2d, 0, sizeof(test_cfg2d)); - test_cfg2d.Enabled = 1; - test_cfg2d.TriggerMode = 1; /* Internal trigger */ + test_cfg2d.Enabled = 0; + test_cfg2d.TriggerMode = 0; /* Internal trigger (0=内部, 1=外部) */ test_cfg2d.TargetWidth = 64; test_cfg2d.TargetHeight = 64; test_cfg2d.TriggerRoiX = 0;