Kaynağa Gözat

4路总开总关改2+2

liyi 11 ay önce
ebeveyn
işleme
4430048b1b

+ 16 - 0
truing_control/PDU-AC_ADA_NEW_6/common/common.c

@@ -71,12 +71,28 @@ void read_config_from_eeprom(void)
 				for(int i =0 ;i < RelaySlaveChaNum;i++)
 				{
 #ifndef SUPPORT_MON
+		#if SUPPORT_CTRL2_LOCK2
+					if(i < 2)
+					{
+						if(board->relay_staging_staus[i])
+						{
+							SET_RL_ON_DELAY_FLAG(board->relay_staging_staus[i]);
+							CLEAR_RL_OFF_DELAY_FLAG(board->relay_staging_staus[i]);
+							SET_RL_ORDER_FLAG(board->relay_staging_staus[i]);
+						}
+					}else
+					{
+						board->md_data.r_data.state.state[i].state = 1;
+					}
+					
+		#else					
 					if(board->relay_staging_staus[i])
 					{
 						SET_RL_ON_DELAY_FLAG(board->relay_staging_staus[i]);
 						CLEAR_RL_OFF_DELAY_FLAG(board->relay_staging_staus[i]);
 						SET_RL_ORDER_FLAG(board->relay_staging_staus[i]);
 					}
+		#endif
 #else
 					board->md_data.r_data.state.state[i].state = 1;
 #endif

+ 24 - 0
truing_control/PDU-AC_ADA_NEW_6/hardware/detection/detection.c

@@ -186,6 +186,12 @@ void EXTI4_15_IRQHandler(void){
 					{
 //						if(board->md_data.r_data.state.state[j].state == RELAY_CLOSE)
 //							continue;
+#if SUPPORT_CTRL2_LOCK2
+							if(j >= 2)
+							{
+								continue;
+							}
+#endif
 						da.channel = 	j;
 						da.method = DELAY_CTRL;
 						da.reg = &board->relay_staging_staus[j];
@@ -232,6 +238,12 @@ void EXTI2_3_IRQHandler(void)
 					{
 //						if(board->md_data.r_data.state.state[k].state ==RELAY_OPEN)
 //							continue;
+#if SUPPORT_CTRL2_LOCK2
+							if(k >= 2)
+							{
+								continue;
+							}
+#endif
 						da.channel =k;
 						da.reg = &board->relay_staging_staus[k];
 						da.status = RELAY_OPEN;
@@ -313,6 +325,12 @@ static void detection_opt(void)
 #if SUPPORT_SELF_LOCK
 							if(board->val_key[k] == 0)
 									continue;
+#endif
+#if SUPPORT_CTRL2_LOCK2
+							if(k >= 2)
+							{
+								continue;
+							}
 #endif
 							async_data da = {0};
 							da.channel =k;
@@ -330,6 +348,12 @@ static void detection_opt(void)
 					{
 						for(uint8_t k = 0; k < PT_SUB_COUNT;k++)
 						{
+#if SUPPORT_CTRL2_LOCK2
+							if(k >= 2)
+							{
+								continue;
+							}
+#endif
 							board->handle_status[k] = board->md_data.r_data.state.state[k].state;
 							async_data da = {0};
 							da.channel =k;

+ 9 - 0
truing_control/PDU-AC_ADA_NEW_6/hardware/relay/relay.c

@@ -104,7 +104,11 @@ void relay_init(void)
 	#if (RelaySlaveChaNum >=3)
 		gpio_mode_set(RELAY_GPIO,GPIO_MODE_OUTPUT,GPIO_PUPD_NONE,RELAY_3);
 		gpio_output_options_set(RELAY_GPIO, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, RELAY_3);
+#if SUPPORT_CTRL2_LOCK2
+		gpio_bit_set(RELAY_GPIO, RELAY_3);
+#else
 		gpio_bit_reset(RELAY_GPIO, RELAY_3);
+#endif
 	#endif
 #if SUPPORT_4_ON_FLASH
 		gpio_mode_set(RELAY_GPIO,GPIO_MODE_OUTPUT,GPIO_PUPD_NONE,RELAY_4);
@@ -114,7 +118,12 @@ void relay_init(void)
 	#if (RelaySlaveChaNum >=4)
 		gpio_mode_set(RELAY_GPIO,GPIO_MODE_OUTPUT,GPIO_PUPD_NONE,RELAY_4);
 		gpio_output_options_set(RELAY_GPIO, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, RELAY_4);
+		
+#if SUPPORT_CTRL2_LOCK2
+		gpio_bit_set(RELAY_GPIO, RELAY_4);
+#else
 		gpio_bit_reset(RELAY_GPIO, RELAY_4);
+#endif
 	#endif
 	
 	#if (RelaySlaveChaNum >=5)

+ 18 - 0
truing_control/PDU-AC_ADA_NEW_6/modbus/BARE/port/port.c

@@ -257,6 +257,12 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
 #if SUPPORT_SELF_LOCK
 												if(board->val_key[j] == 0)
 													continue;
+#endif
+#if SUPPORT_CTRL2_LOCK2
+												if(j >= 2)
+												{
+													continue;
+												}
 #endif
 												da.channel = 	j;
 												da.method = PROMPT_CTRL;
@@ -271,6 +277,12 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
 #if SUPPORT_SELF_LOCK
 												if(board->val_key[j] == 0)
 													continue;										
+#endif
+#if SUPPORT_CTRL2_LOCK2
+												if(j >= 2)
+												{
+													continue;
+												}
 #endif
 												da.channel = 	j;
 												da.method = DELAY_CTRL;
@@ -296,6 +308,12 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
 #if SUPPORT_SELF_LOCK
 												if(board->val_key[start+j] == 0)
 													continue;										
+#endif
+#if SUPPORT_CTRL2_LOCK2
+												if((start + j) >= 2)
+												{
+													continue;
+												}
 #endif
 												da.channel = 	start + j;
 												da.method = PROMPT_CTRL;

+ 18 - 1
truing_control/PDU-AC_ADA_NEW_6/user/board_cfg.h

@@ -69,7 +69,15 @@
 #define   PRJ_1_ALL_MON             0
 
 #define   PRJ_3_NEW_2               0
-#define   PRJ_7_NEW                 1
+#define   PRJ_7_NEW                 0
+
+#define   PRJ_4_SELF_LOCK_2_2       0
+#define   PPRJ_4_BASE_2_2           1
+
+
+
+
+
 
 #if PRJ_8					
 	#define   POWER_TYPE                (POWER_AC)
@@ -130,6 +138,15 @@
 	#define   SUPPORT_DETECTION         1
 	#define   SUPPORT_RELAY_REMENBER		1
 	#define   SUPPORT_ALL_ON_OFF    		1
+#elif PPRJ_4_BASE_2_2
+	#define 	RelaySlaveChaNum 					4
+	#define 	ACSingCurrid 							2 
+	#define   SURPPORT_2_PT             0
+	#define   PT_SUB_COUNT              (RelaySlaveChaNum)
+	#define   SUPPORT_DETECTION         1
+	#define   SUPPORT_RELAY_REMENBER		1
+	#define   SUPPORT_ALL_ON_OFF    		1
+	#define   SUPPORT_CTRL2_LOCK2       1
 #elif PRJ_1_BASE              
 	#define 	RelaySlaveChaNum 					1
 	#define 	ACSingCurrid 							2