Преглед на файлове

南网直流控制板,电流显示异常。

liyi преди 1 година
родител
ревизия
f44528bad3

+ 1 - 0
truing_control/PDU-DC_ADA/common/common.c

@@ -70,6 +70,7 @@ void read_config_from_eeprom(void)
 					}
 				}
 			}
+
 			board->read_eeprom_page(EEPROM_OTHER_ADDR,(uint8_t *)&board->md_data.rw_data.delay_on[0],sizeof(dc_rw_data_t));
 
 			for(uint8_t i = 0 ; i < RelaySlaveChaNum;i++)

+ 2 - 0
truing_control/PDU-DC_ADA/common/common.h

@@ -66,6 +66,8 @@
 #define CLEAR_CONSUMER_END                (START_R_REGISTER + 207)
 
 
+#define INFOMATION                       (START_R_REGISTER +  331)
+
 
 
 

+ 12 - 5
truing_control/PDU-DC_ADA/hardware/adc/ADC.c

@@ -214,10 +214,17 @@ uint32_t DC_I_calfunction(uint16_t da,uint8_t channel)
 		switch(channel)
 		{
 	#if SPPPORT_BIG_HAL
-			case 0:
-			case 1:
-			case 4:
-			case 5:
+			#if SUPPORT_4_GATE_ADC
+				case 0:
+				case 1:
+				case 2:
+				case 3:			
+			#else
+				case 0:
+				case 1:
+				case 4:
+				case 5:
+			#endif
 			{
 				temp_v = da;
 				if(da < 0xA)
@@ -232,7 +239,7 @@ uint32_t DC_I_calfunction(uint16_t da,uint8_t channel)
 				temp_i /= 10;//去掉第3位小数
 				temp_i *= 10;
 				//temp_i += 200;
-				if(temp_i <= 80)
+				if(temp_i <= 40)
 							temp_i = 0;
 			}
 				break;

+ 1 - 1
truing_control/PDU-DC_ADA/hardware/detection/detection.c

@@ -96,9 +96,9 @@ board = get_board();
 		gpio_mode_set(DERECTION_GPIO_2, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, DERECTION_IO_2);
 	#endif
 
+#endif
 	board->detection = get_detection;
 	board->opt_detection = detection_opt;
-#endif
 }
 void key_init(void)
 {

+ 4 - 2
truing_control/PDU-DC_ADA/hardware/electricity/electricity.c

@@ -207,9 +207,9 @@ static void read_vatage(void)
 			uint32_t voltage_chi_2 = 0;
 			voltage_chi_1 = read_stm_voltage(STM32_ADC_V_1) ;
 			//delay_ms(5);
-
+#if SURPPORT_2_PT
 			voltage_chi_2 = read_stm_voltage(STM32_ADC_V_2) ;
-
+#endif
 			board->md_data.r_data.input.voltage = voltage_chi_1 > voltage_chi_2 ? voltage_chi_1 : voltage_chi_2;
 
 			for(int i = 0;i < PT_SUB_COUNT;i++)
@@ -222,6 +222,7 @@ static void read_vatage(void)
 				board->md_data.r_data.output[i].voltage = voltage_chi_2;
 			}			
 #endif
+
 			
 	#endif
 	
@@ -259,6 +260,7 @@ static void read_current(void)
 			{
 				board->md_data.r_data.output[i].current = 0;
 			}
+
 			adc_Avg_value[i] = 0;
 			uint32_t temp_v = board->md_data.r_data.output[i].voltage / 10;
 			uint32_t temp_i = board->md_data.r_data.output[i].current / 10;

+ 13 - 1
truing_control/PDU-DC_ADA/user/board_cfg.h

@@ -51,7 +51,8 @@
 
 #define    DC_OLD_7										0
 #define    DC_NEW_8                   0
-#define    DC_NEW_4                   1
+#define    DC_NEW_4                   0
+#define    DC_NEW_8_NORTH             1
 
 
 #if DC_OLD_7
@@ -74,6 +75,17 @@
 	#define 	SUPPORT_STM32_ADC					1
 	#define   SUPPORT_RELAY_REMENBER    1
 	#define   ACSingCurrid              7
+	#define   SPPPORT_BIG_HAL           1
+	#define   SUPPORT_4_GATE_ADC        1
+#elif DC_NEW_8_NORTH
+	#define 	RelaySlaveChaNum 					8
+	#define 	SUPPORT_DETECTION					1
+	#define   PT_SUB_COUNT              4
+	#define 	SUPPORT_STM32_ADC					1
+	#define   SUPPORT_RELAY_REMENBER    1
+	#define   ACSingCurrid              7
+	#define   SPPPORT_BIG_HAL           1
+	#define   SURPPORT_2_PT             1
 #endif