From 64cf4a779ef5c16c79bbbee27370169dc8d69499 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Mon, 06 May 2024 20:08:30 +0800
Subject: [PATCH] 继续开发

---
 CORE/main.c |   89 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 85 insertions(+), 4 deletions(-)

diff --git a/CORE/main.c b/CORE/main.c
index 972780a..0eb7dfd 100644
--- a/CORE/main.c
+++ b/CORE/main.c
@@ -13,6 +13,16 @@
 #include "key.h"
 #include "flash.h"
 #include "system_run_fun.h"
+#include "system_general_para.h"
+#include "lcd.h"
+#include "upper_com.h"
+#include "rs485_read_data.h"
+#include "valve_control.h"
+#include "wireless_remote_comm.h"
+#include "sizhu_ctrl_word.h"
+#include "sizhu_history_record.h"
+
+
 
 FlagStatus key_awaken_flag_g = RESET;
 //uint8_t lcd_only_one_flag = 0;
@@ -27,13 +37,84 @@
 	hardwareDriversInit();
 	//�洢�IJ�����ʼ��
 	sysStoredParaInit();
-	//���в�����ʼ��
-	sysRunParaInit();
-
+	//���й��ܲ�����ʼ��
+	sysRunFunParaInit();
+	
+	//ϵͳ��ʼ״̬���
+	
+	
+	
+	
+	//����Ҫһֱ�������ⲿ�����ж�
+	allExtiIRQ();
 	IWDT_Clr();
 	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);
+			}
+			
+			/*����ʶ��*/
+			//����������Ҫ�ж�ʶ�𣬳�������ѭ�����ȡIO״̬ʶ��
+			keyPro();
+					
+			/*LCD��ʾ*/
+			lcdDisplayPro();
+			
+			/*�������*/
+			upperComPro();
+			
+			/*�����ɼ�*/
+			
+			
+			
+			/*�ɼ����ϱ��������������*/
+			//?���߲�ͬʱ���У��ɼ������ϱ�֮ǰ��ͬʱ�����Ļ����Ȳɼ���
+			//���������ϱ��ж��߼����ڲɼ�ǰ�棬�ȴ����ɼ����ٴ����ϱ�
+			sysRunFunCtrlPro(&sys_fun_run_ctrl_g,sys_clockBCD_g);
+			
+			/*485�ɼ�*/
+			rs485ReadDataPro(&sys_fun_run_ctrl_g);
+			
+			/*������ʷ��¼�洢*/
+			//������ʷ��¼�洢��������ɼ��У����Ӻ�ȴ��ɼ�����ٴ洢
+			sizhuHistoryRecord(sys_clockBCD_g);
+			
+			
+			/*����*/
+			valveCtrlPro(&sys_fun_run_ctrl_g);
+			
+			
+			/*״̬�֡������ִ���*/
+			
+			
+			
+			/*����������ͨѶ��Ԥ��*/
+			
+			
+			/*˼��ƽ̨����ͨѶ*/
+			WirelessRemoteCommPro(&sys_fun_run_ctrl_g);
+			
+			/*modbus��ַ�����ݸ���*/
+			
+			
+			
+			/*����*/ 
+			//��������²������ߣ�Ҫ���жϣ��������⹩�硢RS485�ɼ������С�Զ��������
+			if(SysKeepRunningStatusGet(sys_fun_run_ctrl_g)==RESET){
+				//���ߴ���
+				
+			}
+				
+			
+		}
 	}
 }
 

--
Gitblit v1.9.3