forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

jinlicong
2024-05-31 08b3909c40a192778719c6262bbee4745682948d
CORE/main.c
@@ -26,6 +26,7 @@
#include "billing.h"
#include "linked_list.h"
#include "other_fun.h"
#include "sys_sleep.h"
FlagStatus key_awaken_flag_g = RESET;
@@ -35,7 +36,7 @@
int main(void)
{
   System_power_on_init();
   /*¸÷ÖÖ³õʼ»¯*/
   //Ó²¼þÇý¶¯³õʼ»¯
   hardwareDriversInit();
@@ -48,13 +49,16 @@
   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ʱ¼äÒì³£±¨¾¯
@@ -105,36 +109,33 @@
         SysAlarmCtrlPro();
         
         
         /*µÚÈý·½ÎÞÏßͨѶ£¬Ô¤Áô*/
         /*˼Öþƽ̨ÎÞÏßͨѶ*/
         WirelessRemoteCommPro(&sys_fun_run_ctrl_g);
         /*modbusµØÖ·±íÊý¾Ý¸üÐÂ*/
         /*ÐÝÃß*/
         //²¿·ÖÇé¿öϲ»ÄÜÐÝÃߣ¬Òª×öÅжϣ¬±ÈÈçÓÐÍ⹩µç¡¢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;
               }
            }
            //ÐÝÃß
         }
//         /*µÚÈý·½ÎÞÏßͨѶ£¬Ô¤Áô*/
//
//
//         /*˼Öþƽ̨ÎÞÏßͨѶ*/
////         WirelessRemoteCommPro(&sys_fun_run_ctrl_g);
//
//         /*modbusµØÖ·±íÊý¾Ý¸üÐÂ*/
//
//
//
//         /*ÐÝÃß*/
//         //²¿·ÖÇé¿öϲ»ÄÜÐÝÃߣ¬Òª×öÅжϣ¬±ÈÈçÓÐÍ⹩µç¡¢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)  //ΪÁ˰´¼üÏÔʾûÓÐÑÓ³Ù¸Ð
      if(lcd_wake_up_flag_g == SET)  //ΪÁ˰´¼üÏÔʾûÓÐÑÓ³Ù¸Ð
         lcdDisplayPro();
      
   }