From 5fd489c5eb68f70f7f8c6c842577e1a9c223e824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=5F666?= <13089258+pony-six-hundred-and-sixty-six@user.noreply.gitee.com> Date: Mon, 20 Jan 2025 14:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=88=B0=E6=9C=9F=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=EF=BC=8C=E5=92=8C=E5=88=B0=E6=9C=9F=E6=A0=87=E5=BF=97?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/main.c | 9 ++++++--- bsp/src/bsp_h308.c | 10 +++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/applications/main.c b/applications/main.c index 0b47a5a..6ddcf4e 100644 --- a/applications/main.c +++ b/applications/main.c @@ -174,7 +174,7 @@ void Preheat_Sensor (rt_uint32_t timeout_counter) void Work_Cnt_Timer_Callback (void *parameter) { work_duration++; - if (IS_H308_EndOfLife()) // 每天检测一下是否过期 + if (IS_H308_EndOfLife() == 1) // 每天检测一下是否过期 { if (Flash_GetNum_Records (kRecordSensoEndOfLife) == 0) { @@ -456,12 +456,15 @@ int main (void) SysControl.last_status = SysControl.status; SysControl.status = kSensorFailureEvent; LOG_D ("传感器失效模式"); - +#if (IOT_MODULE_SWITCH == 1) + Nt26k_Send_Event (kNt26kDeviceFailureEvent); +#endif if (Flash_GetNum_Records (kRecordSensoEndOfLife) == 0) { Flash_Write_Record (kRecordSensoEndOfLife); } - LED_Y_END_OF_LIFE; + // LED_Y_END_OF_LIFE; + Send_Laser_Alarm_Event (kNormalDetectionEvents); } } } diff --git a/bsp/src/bsp_h308.c b/bsp/src/bsp_h308.c index 74a7a74..bedccc4 100644 --- a/bsp/src/bsp_h308.c +++ b/bsp/src/bsp_h308.c @@ -229,8 +229,16 @@ uint8_t IS_H308_EndOfLife(void) { H308.end_of_life = 1; } + else + { + H308.end_of_life = 0; + } } - return H308.end_of_life; + else + { + H308.end_of_life = 0; + } + return H308.end_of_life; } void UART4_Init(void)