This commit is contained in:
2026-03-14 23:29:19 +08:00
parent 8e779dce30
commit a87625df90
4 changed files with 566 additions and 20 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
#define SENSOR_TOTAL_LINES (SENSOR_HEIGHT + 1) // +1 ²ÎÊýÐÐ
#define BYTES_PER_LINE (SENSOR_WIDTH * 2) // ÿÐÐ512×Ö½Ú
#define ALARM_TEMP_RAW 8000 // 80.00¡æ (raw/100)
#define ALARM_TEMP_RAW 800 // 80.0¡æ (raw/10)
extern volatile uint8_t Line_Ready_Flag;
extern volatile uint8_t *Ready_Line_Ptr;
+14 -16
View File
@@ -3,23 +3,21 @@
#include "ch32v30x.h"
/* ---- Temporary debug wiring option ----
* Set to 1 to use USART3 (PB10=TX PB11=RX) for sensor communication.
* This steals the debug printf port — use JTAG debugger for observation.
* Set to 0 for normal operation (USART2 / PA2+PA3). */
#define SENSOR_USE_USART3 0
/* Set to 1 to enable UART commands to configure sensor at boot.
* Set to 0 if sensor is pre-configured via USB to auto-output CMOS/DVP.
* Automatically forced to 1 when SENSOR_USE_USART3 is enabled. */
#if SENSOR_USE_USART3
#define SENSOR_UART_ENABLE 1
#define SENSOR_UART USART3
#else
#define SENSOR_UART_ENABLE 0
#define SENSOR_UART USART2
#endif
/* ---- Sensor UART configuration ----
* 模组已通过 USB 预配置,不需要 MCU UART 配置。
* 注意:USART2 (PA2/PA3) 引脚已被占用,不可使用。
* 如需重新启用 MCU UART 配置传感器,将下面的 #if 0 改为 #if 1。
* 启用后仅可使用 USART3 (PB10/PB11),但会占用 printf 调试口。 */
#if 0 /* MCU UART 配置已禁用 */
#define SENSOR_USE_USART3 1 /* 必须用 USART3,USART2 引脚已占用 */
#define SENSOR_UART_ENABLE 1
#define SENSOR_UART USART3
#define SENSOR_UART_BAUD 115200
#else
#define SENSOR_USE_USART3 0
#define SENSOR_UART_ENABLE 0
#define SENSOR_UART_BAUD 115200
#endif
/**
* Initialize sensor. When SENSOR_UART_ENABLE=1, configures via UART.
+3 -3
View File
@@ -606,7 +606,7 @@ int main(void)
printf("=== TEST PATTERN MODE === No sensor/DVP hardware needed\r\n");
/* Skip Mini212G2_Init() and DVP_Init() */
#else
Mini212G2_Init(); /* Configure sensor for CMOS/DVP Y16 output */
/* 模组已通过 USB 预配置,无需 MCU UART 配置,直接初始化 DVP */
DVP_Init();
#endif
TIM2_Init();
@@ -643,12 +643,12 @@ int main(void)
test_cfg2d.TriggerRoiW = SENSOR_WIDTH;
test_cfg2d.TriggerRoiH = SENSOR_HEIGHT;
test_cfg2d.TriggerCondition = 1; /* Max temperature */
test_cfg2d.TriggerTemperatureThreshold = 8000; /* 80.00°C */
test_cfg2d.TriggerTemperatureThreshold = 800; /* 80.0°C (0.1°C/LSB) */
test_cfg2d.TriggerBurstCount = 3;
test_cfg2d.TriggerInternalIntervalMs = 200;
test_cfg2d.NGioDelay = 200;
Preprocess_Settings_Change(&test_cfg2d, NULL, NULL);
printf("Test default config loaded: trigger thresh=8000 ROI=full burst=3\r\n");
printf("Test default config loaded: trigger thresh=800 ROI=full burst=3\r\n");
}
#endif