From e135ec76e1181c7e7695ac49ec1bd60f44b2738d Mon Sep 17 00:00:00 2001
From: "REASEARCHER\\18383" <1633026436@qq.com>
Date: Wed, 27 Aug 2025 18:09:47 +0800
Subject: [PATCH] =?UTF-8?q?heat80Gear=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8A=A0?=
=?UTF-8?q?=E7=83=AD=E6=8E=A2=E5=A4=B4=E6=95=85=E9=9A=9C=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Hyt2/.vscode/settings.json | 3 +-
Hyt2/APP/Appcfg/app.c | 2 +-
Hyt2/APP/Device/device_Other/device_heat.c | 54 +++++++++++++++++++---
Hyt2/APP/Service/service_statusmonitor.c | 2 +-
Hyt2/APP/Service/service_statusmonitor.h | 2 +-
Hyt2/PROJECT/OS2.ewp | 2 +-
6 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/Hyt2/.vscode/settings.json b/Hyt2/.vscode/settings.json
index 9973bb7..ed2e9eb 100644
--- a/Hyt2/.vscode/settings.json
+++ b/Hyt2/.vscode/settings.json
@@ -25,6 +25,7 @@
"type_traits": "c",
"typeinfo": "c",
"xtr1common": "c",
- "xxexception": "c"
+ "xxexception": "c",
+ "service_statusmonitor.h": "c"
}
}
\ No newline at end of file
diff --git a/Hyt2/APP/Appcfg/app.c b/Hyt2/APP/Appcfg/app.c
index c50074a..880f9cf 100644
--- a/Hyt2/APP/Appcfg/app.c
+++ b/Hyt2/APP/Appcfg/app.c
@@ -197,7 +197,7 @@ static void task_start (void *p_arg)
// term_printf("\n angle init \r\n\r\n");
- task_printf_init();
+// task_printf_init();
//自检模块初始化
diff --git a/Hyt2/APP/Device/device_Other/device_heat.c b/Hyt2/APP/Device/device_Other/device_heat.c
index 89a7fef..4e275ba 100644
--- a/Hyt2/APP/Device/device_Other/device_heat.c
+++ b/Hyt2/APP/Device/device_Other/device_heat.c
@@ -6,6 +6,7 @@
#include "pdebug.h"
#include "cpu.h"
#include "tmp75.h"
+#include "service_statusmonitor.h"
/*
* 温度采集使用的ADC1
*/
@@ -369,14 +370,53 @@ static void ptz_heat_collect_adc1_task()
m_heatData.ext_ntc2 = (short int)(Ntc_temp(adc_data, 3950.0f) - 273.15 + 0.5);
adc_data = 0;
- //判定是否需要加热
- if (g_ptz.H_boad_temp < -25 || g_ptz.V_boad_temp < -25
- || m_heatData.ext_ntc1 < -25 || m_heatData.ext_ntc2 < -25) {
- startHeat();
+
+ //判定温度是否异常
+ if (m_heatData.ext_ntc1 < -90 || m_heatData.ext_ntc2 < -90) {
+ g_ptz.fault_detect.temperature_fault = FAULT;
+ // closeHeat();
+ // ntc1温度异常
+ if (m_heatData.ext_ntc1 < -90 && m_heatData.ext_ntc2 >= -90) {
+ //判定是否需要加热
+ if (m_heatData.ext_ntc2 < -25) {
+ startHeat();
+ }
+ else if (m_heatData.ext_ntc2 > -15) {
+ closeHeat();
+ }
+ }
+
+ // ntc2温度异常
+ else if (m_heatData.ext_ntc2 < -90 && m_heatData.ext_ntc1 >= -90) {
+ //判定是否需要加热
+ if (m_heatData.ext_ntc1 < -25) {
+ startHeat();
+ }
+ else if (m_heatData.ext_ntc1 > -15) {
+ closeHeat();
+ }
+ }
+
+ // ntc1、2都温度异常
+ else {
+ //判定是否需要加热
+ if (g_ptz.temperature < -25 || g_ptz.temperature < -25) {
+ startHeat();
+ }
+ else if (g_ptz.temperature > -15 && g_ptz.temperature > -15) {
+ closeHeat();
+ }
+ }
+
}
- else if (g_ptz.H_boad_temp > -15 && g_ptz.V_boad_temp > -15
- && m_heatData.ext_ntc1 > -15 && m_heatData.ext_ntc2 > -15) {
- closeHeat();
+ else {
+ //判定是否需要加热
+ if (m_heatData.ext_ntc1 < -25 || m_heatData.ext_ntc2 < -25) {
+ startHeat();
+ }
+ else if (m_heatData.ext_ntc1 > -15 && m_heatData.ext_ntc2 > -15) {
+ closeHeat();
+ }
}
}
diff --git a/Hyt2/APP/Service/service_statusmonitor.c b/Hyt2/APP/Service/service_statusmonitor.c
index 60f2467..1fdc1bc 100644
--- a/Hyt2/APP/Service/service_statusmonitor.c
+++ b/Hyt2/APP/Service/service_statusmonitor.c
@@ -85,7 +85,7 @@ static char ptz_temp_volt_current_fault_detect_task()
g_ptz.fault_detect.temperature_fault = NO_FAULT;
}
//¶ȹϣ̨ܿƣ¶ֵ10Чʱ̨
- if(g_ptz.temperature > (PTZ_TEMP_DETECT_MAX + 10.0) || g_ptz.temperature < (PTZ_TEMP_DETECT_MIN - 10.0) )
+ if(g_ptz.temperature > (PTZ_TEMP_DETECT_MAX + 10.0) || g_ptz.temperature < (PTZ_TEMP_DETECT_MIN - 5.0) )
{
max_temperature_fault = FAULT;
ptz_hori_stop(PTZ_HORI_STOP_TIME);
diff --git a/Hyt2/APP/Service/service_statusmonitor.h b/Hyt2/APP/Service/service_statusmonitor.h
index 0005baa..c214647 100644
--- a/Hyt2/APP/Service/service_statusmonitor.h
+++ b/Hyt2/APP/Service/service_statusmonitor.h
@@ -100,7 +100,7 @@
#ifdef PTZ_MEDIUM_WORM_L6235D_AS5047D
//¶ֵ
#define PTZ_TEMP_DETECT_MAX 65.0 //70.0
- #define PTZ_TEMP_DETECT_MIN -25.0//70.0
+ #define PTZ_TEMP_DETECT_MIN -30.0//70.0
//ѹֵ
#define PTZ_VOLT_DETECT_MAX 30.0//30.0
diff --git a/Hyt2/PROJECT/OS2.ewp b/Hyt2/PROJECT/OS2.ewp
index ac274ae..73eb7cc 100644
--- a/Hyt2/PROJECT/OS2.ewp
+++ b/Hyt2/PROJECT/OS2.ewp
@@ -825,7 +825,7 @@