From 65062d0d5b21f838aa0043a15ce54cfab8d72c43 Mon Sep 17 00:00:00 2001
From: wujiazhi <1147861305@qq.com>
Date: Tue, 11 Jun 2024 14:23:53 +0800
Subject: [PATCH] 1.Fixed communication failure between MCU and wireless module 2.Fix the wrong judgment of alkaline lithium power

---
 Soft/working_time_calculate.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/Soft/working_time_calculate.c b/Soft/working_time_calculate.c
new file mode 100644
index 0000000..863e460
--- /dev/null
+++ b/Soft/working_time_calculate.c
@@ -0,0 +1,28 @@
+#include "working_time_calculate.h"
+#include "extern_rtc.h"
+#include "administrator.h"
+#include "system_log.h"
+
+int8_t lith_bat_real_per_g = 100;//Ĭ��100%����
+
+/*����ʣ�๤��ʱ��*/
+void Remaining_WorkingTime_CalculateProcess(int8_t lith_vcc_per,float lith_vcc)
+{
+	if(((&calendar_g)->Minute == 0x16) && ((&calendar_g)->Second == 0x16) &&
+			save_realtime_data_g.lith_bat_working_time_remain_hour &&	sys_display_para_g.sys_and_display_mode != SET_PARA_MODE)
+		save_realtime_data_g.lith_bat_working_time_remain_hour--;
+	int8_t lith_work_time_per = (float)save_realtime_data_g.lith_bat_working_time_remain_hour / (float)LITH_BAT_WORKING_TIME_MAX * 100;
+	if(lith_work_time_per <= 20 && lith_vcc < 3.2f)
+	{
+		__SYS_STATUS_ALARM_BYTES_SET(lith_low);
+		if(lith_work_time_per == 0)
+			__SYS_STATUS_ALARM_BYTES_SET(lith_under);
+	}
+	lith_bat_real_per_g = ((lith_vcc_per > lith_work_time_per) ? lith_work_time_per : lith_vcc_per);
+}
+
+
+
+
+
+

--
Gitblit v1.9.3