From cf4d12fd8322cbb350dd3bc5af8c748e8790ac64 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 05 Jun 2024 17:38:06 +0800
Subject: [PATCH] 继续测试修改

---
 CORE/main.c |   69 ++++++++++++++++++----------------
 1 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/CORE/main.c b/CORE/main.c
index 8117211..db45577 100644
--- a/CORE/main.c
+++ b/CORE/main.c
@@ -24,6 +24,10 @@
 #include "power_manage.h"
 #include "pulse_and_alarm_line.h"
 #include "billing.h"
+#include "linked_list.h"
+#include "other_fun.h"
+#include "sys_sleep.h"
+#include "off_chip_flash.h"
 
 
 FlagStatus key_awaken_flag_g = RESET;
@@ -33,7 +37,7 @@
 int main(void)
 {
 	System_power_on_init();
-
+	
 	/*���ֳ�ʼ��*/
 	//Ӳ��������ʼ��
 	hardwareDriversInit();
@@ -46,17 +50,21 @@
 	allExtiIRQ();
 	
 	IWDT_Clr();
+	
+	lcdDisplayPro();  //��λ��ʾ�ȴ�
+	
 	while(1)
-	{
+	{		
 		if(sys_run_period==SET) 
 		{
 			sys_run_period = RESET;
 			IWDT_Clr();
-			
+
 			if(Get_Extern_Rtc_Time(&sys_clockBCD_g) ==FAIL) //��ȡʱ��
 			{
 				//?RTCʱ���쳣����
-				__SYS_STATUS_ALARM_BYTES_SET(rtc_err);
+				if(__SYS_ALARM_CTL_BYTES_GET(rtc_err) == SET)
+					__SYS_STATUS_ALARM_BYTES_SET(rtc_err,ALARM_ID_RTC_BAT_LOW);
 			}
 			
 			/*����ʶ��*/
@@ -66,7 +74,7 @@
 			/*LCD��ʾ*/
 			lcdDisplayPro();
 			
-			/*�������*/
+			/*��λ������,������modbus���ɼ�����*/
 			upperComPro();
 			
 			/*�Խ��豸����״̬���*/
@@ -79,7 +87,7 @@
 			sysRunFunCtrlPro(&sys_fun_run_ctrl_g,sys_clockBCD_g);
 			
 			/*485�ɼ�*/
-			rs485ReadDataPro(&sys_fun_run_ctrl_g);
+//			rs485ReadDataPro(&sys_fun_run_ctrl_g);
 			
 			/*���㣬�����������*/
 			SettlementPro();
@@ -90,19 +98,16 @@
 			
 			/*��Դ״̬��ȡ*/ //���ڷ���֮ǰ����Ϊ�����н����ƣ�����ǰ�����粻�㣬����Ҫ���
 			GetPwrStatusPro(&pwr_vol_g);
+			
 			/*����*/
 			valveCtrlPro(&sys_fun_run_ctrl_g);
 			
 			
-			/*״̬�֡������ִ���*/
-			//��ʼ״̬��⣬��while֮ǰ�ͼ�������ʼ״̬���������λ����״̬�֣����б�������Ҫ������ʾ��������Ҫ��Ҫ�����ϱ���Ҫ���ǣ�
-			//�ڸ�������ģ�鴦��ʱ�����б������ܱ��������ֿ��ƣ�����������Ӧ��״̬����λ�������ϱ��ı�������λ���ܱ����ϱ������ֿ��ƣ������ڷ��صı�������λ��ͬʱ������ʾ�������������������Ҫ����ͬʱɾ����ʾ������
-			//�����ϱ��ı����ַǿգ������ϱ�������ϱ������У����ظ������� �������ϱ��ɹ�֮����գ�
-			//���ڷ��صı�����ֻ����һ�Σ�����޶������������ñ����֣������Ҫ����������Ӧ���Ʒ��ţ������Ѿ��ر�״̬�����ڹ�ʱ����账������״̬������֮�󱨾��������  �ж��������ͬʱ���ڵģ�Ҫ�����жϣ���Ϊ�����ִ����Ĺط����Ͳ�һ�£�ǿ���Թط������ȼ����ߡ�
-			//��������״̬Ҫ���Զ��������ƣ����������ֵ���ֱ�ӿ��ص��������֮ǰ�����ط���ԭ���������ɵ�ǿ���Թط�������������֮���Զ�����������Ƿ������ɵ�ǿ���Թط��������Զ������������Ҫ��¼֮ǰ����ǿ���Թط���ԭ��
-			//��¼���ϴιط�ԭ����Ҫ�����ȼ����ǻ��ƣ� ǿ���Թط����Ƿ�ǿ���Թط��� �������ɵ�ǿ���Թط����������ɵġ�
-			//
+			/*ϵͳ������ɢС���ܴ���*/
+			OtherFunPro();
 			
+			/*״̬�֡������ִ���*/
+			SysAlarmCtrlPro();
 			
 			
 			/*����������ͨѶ��Ԥ��*/
@@ -115,25 +120,25 @@
 			
 			
 			
-			/*����*/ 
-			//��������²������ߣ�Ҫ���жϣ��������⹩�硢RS485�ɼ������С�Զ��������
-			if(SysKeepRunningStatusGet(sys_fun_run_ctrl_g)==RESET){
-				//���ߴ���
-				if(pulse_exti_flag==SET){ //�ȴ����������
-					for(uint8_t count_i=0;count_i<(PULSE_CHECK_DELAY_MS &0xff);count_i++){
-						delay_ms(1);
-						if(pulse_exti_flag == RESET) 
-							break;
-						
-					}
-					
-					//����
-				}
-				
-			}
-				
-			
+//			/*����*/ 
+//			//��������²������ߣ�Ҫ���жϣ��������⹩�硢RS485�ɼ������С�Զ��������
+//			if(SysKeepRunningStatusGet(sys_fun_run_ctrl_g)==RESET){
+//				//���ߴ���
+//				if(pulse_exti_flag==SET){ //�ȴ����������
+//					for(uint8_t count_i=0;count_i<(PULSE_CHECK_DELAY_MS &0xff);count_i++){
+//						delay_ms(1);
+//						if(pulse_exti_flag == RESET) 
+//							break;						
+//					}				
+//				}
+//				//����
+//				DeepSleepMode();
+//			}
 		}
+		
+		if(lcd_wake_up_flag_g == SET)  //Ϊ�˰�����ʾû���ӳٸ�
+			lcdDisplayPro();
+		
 	}
 }
 

--
Gitblit v1.9.3