|
|
@@ -465,6 +465,7 @@ static void LimiT_enable_check(uint8_t ch_x,uint32_t Lt_v)
|
|
|
if(ch_x > 3)
|
|
|
{
|
|
|
return;
|
|
|
+ }
|
|
|
#endif
|
|
|
//ͨµÀ×î´óµçѹ
|
|
|
if((temp0 & AC3PPDU_Vmax_LT_enable) == AC3PPDU_Vmax_LT_enable)
|
|
|
@@ -555,11 +556,14 @@ static void RL_Over_Func()
|
|
|
|
|
|
static void key_io_control()
|
|
|
{
|
|
|
+#if SUPPORT_DETECTION
|
|
|
AC3PPDU_Modbus_Reg[Mb_Dbuff_Detection] = detection_value;
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
void switch_recode()
|
|
|
{
|
|
|
+#if SUPPORT_DETECTION
|
|
|
#if SUPPORT_DETECT_REMENBER
|
|
|
#if SUPPORT_DOUBLE_FIRE
|
|
|
if(detection_value != 0x3)
|
|
|
@@ -600,7 +604,9 @@ void switch_recode()
|
|
|
orderFlag[i]=true;
|
|
|
}
|
|
|
#if SUPPORT_ZERO_LINE
|
|
|
- handle_status_N = (AC3PPDU_Modbus_Reg[Mb_Dbuff_CHNLT_ST_Addr] & 0x1);
|
|
|
+ handle_status_N = (AC3PPDU_Modbus_Reg[Mb_Dbuff_CHNLT_ST_Addr] & 0x1);
|
|
|
+ AC3PPDU_RL_N_time.LT_state &= 0xffffff7e;
|
|
|
+ orderFlag_N = true;
|
|
|
#endif
|
|
|
handle_detection[0] = 0;
|
|
|
}
|
|
|
@@ -617,15 +623,16 @@ void switch_recode()
|
|
|
}
|
|
|
#if SUPPORT_ZERO_LINE
|
|
|
uint32_t data = (AC3PPDU_RL_N_time.LT_state & (~0x40));
|
|
|
- AC3PPDU_RL_time[i + CH1_out].LT_state = (data & 0x40);
|
|
|
- AC3PPDU_RL_time[i + CH1_out].LT_state |= handle_status[i];
|
|
|
- orderFlag_N = true;
|
|
|
+ AC3PPDU_RL_N_time.LT_state = (data & 0x40);
|
|
|
+ AC3PPDU_RL_N_time.LT_state |= handle_status_N;
|
|
|
+ orderFlag_N = true;
|
|
|
#endif
|
|
|
handle_detection[0] = 1;
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -776,7 +783,7 @@ int main(void)
|
|
|
#endif
|
|
|
|
|
|
// switch_recode();
|
|
|
-
|
|
|
+#if SUPPORT_DETECTION
|
|
|
#if SUPPORT_DOUBLE_FIRE
|
|
|
if(detection_value != 0x3)
|
|
|
#else
|
|
|
@@ -798,7 +805,7 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+#endif
|
|
|
|
|
|
for(int i = 0;i < Output_ChN_default;i++)
|
|
|
{
|
|
|
@@ -1011,10 +1018,12 @@ static void MODbus_CMD_New(void)
|
|
|
break;
|
|
|
case Mb_Dbuff_RL_Allon_Addr: //relay all on
|
|
|
{
|
|
|
-#if SUPPORT_DOUBLE_FIRE
|
|
|
- if(detection_value == 0x3)
|
|
|
-#else
|
|
|
- if(detection_value == 1)
|
|
|
+#if SUPPORT_DETECTION
|
|
|
+ #if SUPPORT_DOUBLE_FIRE
|
|
|
+ if(detection_value == 0x3)
|
|
|
+ #else
|
|
|
+ if(detection_value == 1)
|
|
|
+ #endif
|
|
|
#endif
|
|
|
{
|
|
|
RL_Allon_flag = true;
|
|
|
@@ -1037,10 +1046,12 @@ static void MODbus_CMD_New(void)
|
|
|
break;
|
|
|
case Mb_Dbuff_RL_Alloff_Addr: //relay all off
|
|
|
{
|
|
|
-#if SUPPORT_DOUBLE_FIRE
|
|
|
- if(detection_value == 0x3)
|
|
|
-#else
|
|
|
- if(detection_value == 1)
|
|
|
+#if SUPPORT_DETECTION
|
|
|
+ #if SUPPORT_DOUBLE_FIRE
|
|
|
+ if(detection_value == 0x3)
|
|
|
+ #else
|
|
|
+ if(detection_value == 1)
|
|
|
+ #endif
|
|
|
#endif
|
|
|
{
|
|
|
RL_Alloff_flag = true;
|
|
|
@@ -1081,16 +1092,18 @@ static void MODbus_CMD_New(void)
|
|
|
AC3PPDU_RL_N_time.LT_state = data;
|
|
|
orderFlag_N = true;
|
|
|
temp_addr = temp_addr << 1;
|
|
|
- temp_addr +=ERom_CHNLT_ST_Addr;
|
|
|
+ temp_addr +=ERom_CH1LT_ST_Addr;
|
|
|
Eeprom_Rbuf[temp_addr] = data;
|
|
|
AT24CxxWriteOneByte(temp_addr,Eeprom_Rbuf[temp_addr]);
|
|
|
#endif
|
|
|
}else{
|
|
|
+#if SUPPORT_DETECTION
|
|
|
#if SUPPORT_DOUBLE_FIRE
|
|
|
if(detection_value == 0x3)
|
|
|
- #else
|
|
|
+ #else
|
|
|
if(detection_value == 1)
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
+#endif
|
|
|
{
|
|
|
if(AC3PPDU_Modbus_Reg[Mb_Dbuff_VLit1_max_Addr + temp_addr] <= THRESHOULD_JUDGMENT)
|
|
|
{
|
|
|
@@ -1127,7 +1140,9 @@ static void MODbus_CMD_New(void)
|
|
|
case Mb_Dbuff_OUTCH1_ST_Addr ... Mb_Dbuff_OUTCH4_ST_Addr: //set output channel relay's status
|
|
|
{
|
|
|
#if SUPPORT_DOUBLE_FIRE
|
|
|
+ #if SUPPORT_DETECTION
|
|
|
if(detection_value == 0x3)
|
|
|
+ #endif
|
|
|
{
|
|
|
temp_addr = base_addr - Mb_Dbuff_OUTCH1_ST_Addr;
|
|
|
for(int i = temp_addr; i < Output_ChN_default; i += 4)
|
|
|
@@ -1164,8 +1179,9 @@ static void MODbus_CMD_New(void)
|
|
|
}
|
|
|
}
|
|
|
#else
|
|
|
+ #if SUPPORT_DETECTION
|
|
|
if(detection_value == 1)
|
|
|
-
|
|
|
+ #endif
|
|
|
{
|
|
|
temp_addr = base_addr - Mb_Dbuff_OUTCH1_ST_Addr;
|
|
|
//OutUnit_control_flag[temp_addr] = 1;
|