| | |
| | | Pulse_And_Alarm_Line_IO_Init(); |
| | | |
| | | RS485_read_data_GPIO_Init(); |
| | | |
| | | WRC_PWR_GPIO_Init(); //ÎÞÏßÔ¶´«µçÔ´¿ØÖÆIO |
| | | } |
| | | |
| | | //ËùÓÐÍâÉèÇý¶¯ÅäÖà |
| | |
| | | |
| | | GPIO_EXTI_Init( EXT_RTC_INT_PORT, EXT_RTC_INT_PIN, EXTI_FALLING, ENABLE); |
| | | GPIO_EXTI_Init( KEY1_PORT, KEY1_PIN, EXTI_FALLING, ENABLE); |
| | | GPIO_EXTI_Init( KEY2_PORT, KEY2_PIN, EXTI_FALLING, ENABLE); |
| | | GPIO_EXTI_Init( KEY3_PORT, KEY3_PIN, EXTI_FALLING, ENABLE); |
| | | GPIO_EXTI_Init( KEY4_PORT, KEY4_PIN, EXTI_FALLING, ENABLE); |
| | | // GPIO_EXTI_Init( KEY2_PORT, KEY2_PIN, EXTI_FALLING, ENABLE); |
| | | // GPIO_EXTI_Init( KEY3_PORT, KEY3_PIN, EXTI_FALLING, ENABLE); |
| | | // GPIO_EXTI_Init( KEY4_PORT, KEY4_PIN, EXTI_FALLING, ENABLE); |
| | | |
| | | GPIO_EXTI_Init( LITH_PWR_LOSE_PORT, LITH_PWR_LOSE_PIN, EXTI_FALLING, ENABLE); |
| | | GPIO_EXTI_Init( ALKA_PWR_LOSE_PORT, ALKA_PWR_LOSE_PIN, EXTI_FALLING, ENABLE); |
| | | // GPIO_EXTI_Init( ALKA_PWR_LOSE_PORT, ALKA_PWR_LOSE_PIN, EXTI_FALLING, ENABLE); |
| | | |
| | | GPIO_EXTI_Init( LIMIT_TRIGGER_PORT, LIMIT_TRIGGER_PIN, EXTI_FALLING, ENABLE); |
| | | |
| | | /*Âö³åÏßÖжÏÅäÖÃÑ¡Ôñ,û¿ªÆô¸´ÓÃÇÒ¿ªÆôÁËÂö³å*/ |
| | | if(((flow_meter_para_g.broken_line_multiplex & BROKEN_LINE_MUTIPLEX_PULSE)!=BROKEN_LINE_MUTIPLEX_PULSE)&& \ |
| | |
| | | SYSTEM_EEP_IDENTIFICATION_T sys_eep_id_A_l={0}; |
| | | SYSTEM_EEP_IDENTIFICATION_T sys_eep_id_B_l={0}; |
| | | uint8_t eep_none_flag = 1; //0´ú±í¿Õ£¬·Ç0´ú±í·Ç¿Õ |
| | | uint8_t buf_test[10]; |
| | | |
| | | //?²âÊÔÌí¼Ó |
| | | // EEPROM_test(); |
| | | |
| | | |
| | | EEPROM_CTRL_ENABLE; |
| | | |
| | | //¶ÁÈ¡²ÎÊý³õʼ»¯ÅäÖñêʶ |
| | | //Èç¹û±êʶÎÞ·¨Ê¶±ðÔò´ú±í´æ´¢ÐèҪȫ²¿Ð´ÈëĬÈÏÖµ |
| | | //Èç¹û±êʶʶ±ð³É¹¦´ú±íÒÑÓвÎÊý£¬²ÎÊýÖ±½Ó´Ó´æ´¢ÀïÃæ¶ÁÈ¡ |
| | |
| | | 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; |
| | | |
| | | system_status_word_g.status_word.lcd_mode = system_function_ctrl_word_g.fun_ctrl_word.lcd_mode; |
| | | |
| | | /****ÍⲿRTCÅäÖü°²ÎÊý³õʼ»¯***********/ |
| | | Set_Rtc_UpdataInterrupt(); //ÉèÖÃRTCΪÃëÖÐ¶Ï |
| | |
| | | if(Get_Extern_Rtc_Time(&sys_clockBCD_g) ==FAIL) |
| | | { |
| | | //²ÉÓÃ´æ´æ´¢¶ÁÈ¡µÄʱ¼äÉèÖõ½RTC |
| | | Set_Extern_Rtc_Time(save_realtime_data_g.record_time_BCD.year,save_realtime_data_g.record_time_BCD.month,save_realtime_data_g.record_time_BCD.day, \ |
| | | 1,save_realtime_data_g.record_time_BCD.hour,save_realtime_data_g.record_time_BCD.min,save_realtime_data_g.record_time_BCD.sec); |
| | | if(Set_Extern_Rtc_Time(save_realtime_data_g.record_time_BCD.year,save_realtime_data_g.record_time_BCD.month,save_realtime_data_g.record_time_BCD.day, \ |
| | | 1,save_realtime_data_g.record_time_BCD.hour,save_realtime_data_g.record_time_BCD.min,save_realtime_data_g.record_time_BCD.sec) ==FAIL){ |
| | | //´æ´¢ÖÐʱ¼ä´íÎóÔòÉèÖÃĬÈÏÖµ |
| | | Set_Extern_Rtc_Time(sys_clockBCD_g.year,sys_clockBCD_g.month,sys_clockBCD_g.day, 1,sys_clockBCD_g.hour,sys_clockBCD_g.min,sys_clockBCD_g.sec) ; |
| | | } |
| | | } |
| | | |
| | | //·§ÃÅÔËÐгõʼ»¯ |
| | |
| | | start_rs485_g = RS485_START_REASON_RECORD; |
| | | |
| | | |
| | | if(start_rs485_g != RS485_START_REASON_NONE){ |
| | | //Éϱ¨Ö®Ç°´¥·¢²É¼¯ |
| | | if(start_wrc_g != WRC_MEANS_NONE){ |
| | | start_rs485_g = RS485_START_REASON_REPORT; |
| | | } |
| | | |
| | | if(start_rs485_g != RS485_START_REASON_NONE){ |
| | | start_rs485_g = RS485_START_REASON_NONE; |
| | | sys_fun_run_ctrl_p->rs485_ctrl_flag.start_flag = SET; |
| | | if(sys_fun_run_ctrl_p->rs485_ctrl_flag.running_flag ==RESET) |
| | | sys_fun_run_ctrl_p->rs485_ctrl_flag.start_flag = SET; |
| | | } |
| | | |
| | | /*·§¿Ø¿ØÖÆ£¬·§¿ØÍ¨¹ý°´¼ü»òÕßÖ¸Áî¡¢Òì³£µÈ¿ØÖÆ£¬ÐèÒª²Ù×÷ʱֱ½Óµ÷ÓÃValveCtrlOrderº¯Êý¼´¿É£¬²»ÔÚ´Ë´¦Æô¶¯*/ |
| | |
| | | if(start_wrc_g != WRC_MEANS_NONE){ |
| | | wrc_ctrl_para_g.wrc_start_flag = start_wrc_g; |
| | | start_wrc_g = WRC_MEANS_NONE; |
| | | if(sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag == RESET){ |
| | | if((sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag == RESET)&&(sys_fun_run_ctrl_p->wrc_ctrl_flag.running_flag == RESET )){ |
| | | pwr_vol_g.alka_flag = AMS_WRC_BEFORE; |
| | | sys_fun_run_ctrl_p->wrc_ctrl_flag.start_flag = SET; |
| | | } |