| | |
| | | #include "key.h" |
| | | #include "valve_control.h" |
| | | #include "system_mem_para.h" |
| | | #include "system_run_fun.h" |
| | | #include "power_manage.h" |
| | | #include "pulse_and_alarm_line.h" |
| | | #include "tim.h" |
| | | |
| | | void NMI_Handler(void) |
| | | { |
| | |
| | | if(KEY2_IO_READ==Bit_RESET) |
| | | { |
| | | //²É¼¯Á÷Á¿¼ÆÊý¾Ý²¢´¥·¢Éϱ¨ |
| | | |
| | | |
| | | start_rs485_g = RS485_START_REASON_KEY; |
| | | start_wrc_g = WRC_MEANS_KEY; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | if(GPIO_EXTI_EXTIISR_ChkEx(LITH_PWR_LOSE_PORT, LITH_PWR_LOSE_PIN) == SET) |
| | | { |
| | | GPIO_EXTI_EXTIISR_ClrEx(LITH_PWR_LOSE_PORT, LITH_PWR_LOSE_PIN); |
| | | |
| | | // __SYS_STATUS_ALARM_BYTES_SET(lith_remove); |
| | | pwr_vol_g.lith_lose_check_flag = SET; |
| | | } |
| | | if(GPIO_EXTI_EXTIISR_ChkEx(ALKA_PWR_LOSE_PORT, ALKA_PWR_LOSE_PIN) == SET) |
| | | { |
| | | GPIO_EXTI_EXTIISR_ClrEx(ALKA_PWR_LOSE_PORT, ALKA_PWR_LOSE_PIN); |
| | | |
| | | // __SYS_STATUS_ALARM_BYTES_SET(alka_remove); |
| | | |
| | | pwr_vol_g.alka_lose_check_flag = SET; |
| | | } |
| | | |
| | | |
| | | if(GPIO_EXTI_EXTIISR_ChkEx(LF_PULSE_INT_PORT, LF_PULSE_INT_PIN) == SET) //¼Æ·ÑµÍƵÂö³å |
| | | { |
| | | GPIO_EXTI_EXTIISR_ClrEx(LF_PULSE_INT_PORT, LF_PULSE_INT_PIN); |
| | | //Ŀǰ½ö¿ªÆô¼Æ·ÑÂö³å¹¦ÄÜÇÒûÓб»¸´ÓòÅÐèÒª´¦Àí |
| | | if(((flow_meter_para_g.broken_line_multiplex & BROKEN_LINE_MUTIPLEX_PULSE)!=BROKEN_LINE_MUTIPLEX_PULSE)&& \ |
| | | ((flow_meter_para_g.flow_meter_conn_type==FLOW_METER_CONN_PULSE)||(flow_meter_para_g.flow_meter_conn_type==FLOW_METER_CONN_RS485_AND_PULSE))){ |
| | | pulse_exti_flag = SET; |
| | | BTx_CR1_CHEN_Setable(BT1,ENABLE); //¿ªÆô¶¨Ê±Æ÷ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // if(GPIO_EXTI_EXTIISR_ChkEx(VALVE_FORCED_OPEN_PORT, VALVE_FORCED_OPEN_PIN) == SET) |
| | |
| | | ////#endif |
| | | //// } |
| | | //// } |
| | | // if(GPIO_EXTI_EXTIISR_ChkEx(LITHIUM_PWR_DOWN_PORT, LITHIUM_PWR_DOWN_PIN) == SET) |
| | | // { |
| | | // GPIO_EXTI_EXTIISR_ClrEx(LITHIUM_PWR_DOWN_PORT, LITHIUM_PWR_DOWN_PIN); |
| | | //#ifdef RS232_PRINTF |
| | | // printf("﮵çµôµç\r\n"); |
| | | //#endif |
| | | // __SYS_STATUS_ALARM_BYTES_SET(lith_remove); |
| | | // pwr_vol_g.lith_vcc_per = 0; |
| | | // SLAVE_PWR_OFF; //µôµçºóС°åµçѹ²»ÎÈ£¬»á²úÉúÁ÷Á¿Êý¾Ý»ìÂÒ£¬´Ó¶øµ¼Ö¸÷ÖÖ·ÇÕý³£±¨¾¯£¬ËùÒÔÐèÒª¹Ø±ÕµçÔ´£¬»Ö¸´ºóÔÙ¿ªÆô¡£ |
| | | //// pwr_vol_g.lith_flag = LMS_PERIOD; // µôµçºóÁ¢Âí²É¼¯Ò»´ÎµçÁ¿ |
| | | // } |
| | | // if(GPIO_EXTI_EXTIISR_ChkEx(ALKALI_PWR_DOWN_PORT, ALKALI_PWR_DOWN_PIN) == SET) |
| | | // { |
| | | // GPIO_EXTI_EXTIISR_ClrEx(ALKALI_PWR_DOWN_PORT, ALKALI_PWR_DOWN_PIN); |
| | | //#ifdef RS232_PRINTF |
| | | // printf("¼îµçµôµç\r\n"); |
| | | //#endif |
| | | // __SYS_STATUS_ALARM_BYTES_SET(alka_remove); |
| | | // |
| | | //// pwr_vol_g.alka_flag = AMS_PERIOD; // µôµçºóÁ¢Âí²É¼¯Ò»´ÎµçÁ¿ |
| | | // } |
| | | |
| | | } |
| | | |
| | | void All_Exti_Init(void) |
| | |
| | | // |
| | | // GPIO_EXTI_Init( KEYA_S1_PORT, KEYA_S1_PIN, EXTI_FALLING, ENABLE); //ÊäÈëÖжϴò¿ª¡¢Ï½µÑØ´¥·¢¡¢¿ªÆôÊý×ÖÂ˲¨ //PD6 |
| | | // GPIO_EXTI_Init( VALVE_FORCED_OPEN_PORT, VALVE_FORCED_OPEN_PIN, EXTI_RISING, ENABLE); //PA1 |
| | | // GPIO_EXTI_Init( LITHIUM_PWR_DOWN_PORT, LITHIUM_PWR_DOWN_PIN, EXTI_FALLING, ENABLE); //PF11 |
| | | // GPIO_EXTI_Init( LITH_PWR_LOSE_PORT, LITH_PWR_LOSE_PIN, EXTI_FALLING, ENABLE); //PF11 |
| | | //// GPIO_EXTI_Init( LIT_PWR_UNDER_PORT, LIT_PWR_UNDER_PIN, EXTI_FALLING, ENABLE); //PF6 |
| | | // GPIO_EXTI_Init( ALKALI_PWR_DOWN_PORT, ALKALI_PWR_DOWN_PIN, EXTI_FALLING, ENABLE); //PA4 |
| | | // GPIO_EXTI_Init( ALKA_PWR_LOSE_PORT, ALKA_PWR_LOSE_PIN, EXTI_FALLING, ENABLE); //PA4 |
| | | //// GPIO_EXTI_Init( UNCAP_DETECTION_PORT, UNCAP_DETECTION_PIN, EXTI_RISING, ENABLE); //PF5 |
| | | |
| | | //// GPIO_PINWKSEL_SetEx(PINWKEN_PF5,GPIO_PINWKEN_PINWKSEL_RISING); |