| | |
| | | #include "system_eep_mem_manage.h" |
| | | #include "system_mem_para.h" |
| | | #include "eeprom.h" |
| | | #include "mbcrc.h" |
| | | #include "mbcrc1.h" |
| | | #include "gpio.h" |
| | | #include "extern_rtc.h" |
| | | #include "key.h" |
| | |
| | | #include "power_manage.h" |
| | | #include "pulse_and_alarm_line.h" |
| | | #include "valve_control.h" |
| | | #include "linked_list.h" |
| | | |
| | | |
| | | RS485_START_REASON start_rs485_g = RS485_START_REASON_NONE; |
| | |
| | | |
| | | void allGpioInit(void) |
| | | { |
| | | |
| | | E2P_Ctrl_Gpio_Init(); |
| | | |
| | | RTC_GPIO_Init(); |
| | | |
| | | Key_GPIO_Init(); |
| | |
| | | SYSTEM_EEP_IDENTIFICATION_T sys_eep_id_B_l={0}; |
| | | uint8_t eep_none_flag = 1; //0´ú±í¿Õ£¬·Ç0´ú±í·Ç¿Õ |
| | | |
| | | EEPROM_CTRL_ENABLE; |
| | | //¶ÁÈ¡²ÎÊý³õʼ»¯ÅäÖñêʶ |
| | | //Èç¹û±êʶÎÞ·¨Ê¶±ðÔò´ú±í´æ´¢ÐèҪȫ²¿Ð´ÈëĬÈÏÖµ |
| | | //Èç¹û±êʶʶ±ð³É¹¦´ú±íÒÑÓвÎÊý£¬²ÎÊýÖ±½Ó´Ó´æ´¢ÀïÃæ¶ÁÈ¡ |
| | |
| | | //Èç¹û²¹¶¡±êʶÎÞ·¨Ê¶±ð»òÕßСÓÚ²¹¶¡Ê±¼ä£¬ÔòÐèÒª´ò²¹¶¡´¦Àí |
| | | allParaPatchPro(); |
| | | |
| | | EEPROM_CTRL_DISABLE; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | void sysRunFunParaInit(void) |
| | | { |
| | | //¸÷ÖÖ¹¦ÄÜÄ£¿éÔËÐÐËùÐèµÄ²ÎÊý³õʼ»¯ |
| | | |
| | | /*״̬×Ö³õʼ*/ |
| | | system_status_word_g.status_word.account_state = (system_function_ctrl_word_g.fun_ctrl_word.account_open == 1)?1:0; |
| | | system_status_word_g.status_word.valve_lock = (save_valve_para_g.valve_lock_state == VL_LOCK)?1:0; |
| | | system_status_word_g.status_word.virtual_billing = (system_function_ctrl_word_g.fun_ctrl_word.virtual_billing == 1)?1:0; |
| | | system_status_word_g.status_word.billing_type = system_function_ctrl_word_g.fun_ctrl_word.billing_type; |
| | | |
| | | |
| | | /****ÍⲿRTCÅäÖü°²ÎÊý³õʼ»¯***********/ |
| | | Set_Rtc_UpdataInterrupt(); //ÉèÖÃRTCΪÃëÖÐ¶Ï |
| | |
| | | /*·§¿Ø¿ØÖÆ£¬·§¿ØÍ¨¹ý°´¼ü»òÕßÖ¸Áî¡¢Òì³£µÈ¿ØÖÆ£¬ÐèÒª²Ù×÷ʱֱ½Óµ÷ÓÃValveCtrlOrderº¯Êý¼´¿É£¬²»ÔÚ´Ë´¦Æô¶¯*/ |
| | | |
| | | |
| | | /*Ô¶³ÌͨѶÆô¶¯¿ØÖÆ£¬°´¼ü¡¢¼ä¸ô¡¢ÖÜÆÚ¡¢Òì³£±¨¾¯µÈ*/ |
| | | |
| | | /*Ô¶³ÌͨѶÆô¶¯¿ØÖÆ£¬°´¼ü¡¢¼ä¸ô¡¢ÖÜÆÚ¡¢Òì³£±¨¾¯¡¢Öر¨µÈ*/ |
| | | if((wrc_para_sizhu_g.time_start_type&WRC_TIME_START_INTERVAL)==WRC_TIME_START_INTERVAL){ |
| | | for(uint16_t count_i=0;count_i<wrc_para_sizhu_g.timing_send_num;count_i++){ |
| | | if(count_i>=12) |
| | |
| | | start_wrc_g = WRC_MEANS_RTC_INTERVAL; |
| | | } |
| | | |
| | | if((wrc_ctrl_para_g.wrc_restart_num_cnt > 0)&&(wrc_ctrl_para_g.wrc_restart_time_sec_cnt == 0)){ |
| | | if(start_wrc_g == WRC_MEANS_NONE){ |
| | | //´¥·¢Öر¨Éϱ¨ |
| | | start_wrc_g = WRC_MEANS_AGAIN; |
| | | wrc_ctrl_para_g.wrc_restart_num_cnt -- ; |
| | | } |
| | | } |
| | | |
| | | |
| | | if(start_wrc_g != WRC_MEANS_NONE){ |
| | | wrc_ctrl_para_g.wrc_start_flag = start_wrc_g; |
| | | start_wrc_g = WRC_MEANS_NONE; |
| | | sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag = SET; |
| | | if(sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag == RESET){ |
| | | pwr_vol_g.alka_flag = AMS_WRC_BEFORE; |
| | | sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag = SET; |
| | | } |
| | | } |
| | | |
| | | } |