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

---
 CORE/main.c |  133 +++++---------------------------------------
 1 files changed, 16 insertions(+), 117 deletions(-)

diff --git a/CORE/main.c b/CORE/main.c
index c0a4f93..5f6f615 100644
--- a/CORE/main.c
+++ b/CORE/main.c
@@ -1,124 +1,23 @@
 #include "main.h"
-#include "gpio.h"
 #include "rcc_config.h"
-#include "uart.h"
-#include "tim.h"
-#include "rtc.h"
-#include "exti.h"
-#include "adc.h"
-#include "i2c.h"
-#include "extern_rtc.h"
-#include "spi.h"
-#include "eeprom.h"
-#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"
-#include "power_manage.h"
-
-
-
-FlagStatus key_awaken_flag_g = RESET;
-//uint8_t lcd_only_one_flag = 0;
+#include "project_test.h"
 
 
 int main(void)
 {
-	System_power_on_init();
-
-	/*���ֳ�ʼ��*/
-	//Ӳ��������ʼ��
-	hardwareDriversInit();
-	//�洢�IJ�����ʼ��
-	sysStoredParaInit();
-	//���й��ܲ�����ʼ����������ʼ״̬���
-	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);
-			
-			/*��Դ״̬��ȡ*/ //���ڷ���֮ǰ����Ϊ�����н����ƣ�����ǰ�����粻�㣬����Ҫ���
-			GetPwrStatusPro(&pwr_vol_g);
-			/*����*/
-			valveCtrlPro(&sys_fun_run_ctrl_g);
-			
-			
-			/*״̬�֡������ִ���*/
-			//��ʼ״̬��⣬��while֮ǰ�ͼ�������ʼ״̬���������λ����״̬�֣����б�������Ҫ������ʾ��������Ҫ��Ҫ�����ϱ���Ҫ���ǣ�
-			//�ڸ�������ģ�鴦��ʱ�����б������ܱ��������ֿ��ƣ�����������Ӧ��״̬����λ�������ϱ��ı�������λ���ܱ����ϱ������ֿ��ƣ������ڷ��صı�������λ��ͬʱ������ʾ�������������������Ҫ����ͬʱɾ����ʾ������
-			//�����ϱ��ı����ַǿգ������ϱ�������ϱ������У����ظ������� �������ϱ��ɹ�֮����գ�
-			//���ڷ��صı�����ֻ����һ�Σ�����޶������������ñ����֣������Ҫ����������Ӧ���Ʒ��ţ������Ѿ��ر�״̬�����ڹ�ʱ����账������״̬������֮�󱨾��������  �ж��������ͬʱ���ڵģ�Ҫ�����жϣ���Ϊ�����ִ����Ĺط����Ͳ�һ�£�ǿ���Թط������ȼ����ߡ�
-			//��������״̬Ҫ���Զ��������ƣ����������ֵ���ֱ�ӿ��ص��������֮ǰ�����ط���ԭ���������ɵ�ǿ���Թط�������������֮���Զ�����������Ƿ������ɵ�ǿ���Թط��������Զ������������Ҫ��¼֮ǰ����ǿ���Թط���ԭ��
-			//��¼���ϴιط�ԭ����Ҫ�����ȼ����ǻ��ƣ� ǿ���Թط����Ƿ�ǿ���Թط��� �������ɵ�ǿ���Թط����������ɵġ�
-			//
-			
-			
-			
-			/*����������ͨѶ��Ԥ��*/
-			
-			
-			/*˼��ƽ̨����ͨѶ*/
-			WirelessRemoteCommPro(&sys_fun_run_ctrl_g);
-			
-			/*modbus��ַ�����ݸ���*/
-			
-			
-			
-			/*����*/ 
-			//��������²������ߣ�Ҫ���жϣ��������⹩�硢RS485�ɼ������С�Զ��������
-			if(SysKeepRunningStatusGet(sys_fun_run_ctrl_g)==RESET){
-				//���ߴ���
-				
-			}
-				
-			
-		}
-	}
+  System_power_on_init();
+  All_GPIO_Init_test();
+  UART_Init_test();
+  ALL_ADC_Init_Test();
+  Iic_Init_Test();
+  // ALL_GPIO_EXTI_test();
+#if Debug_Model 
+  AppNvr_Print();
+  project_test_9();// ʱ�Ӿ��Ȳ���
+  project_test_7(); // Һ����ʾ
+#endif
+  while (1)
+  {
+    Project_Test();
+  }
 }
-
-
-

--
Gitblit v1.9.3