Browse Source

新5路板,4路板。bootloader 跳转需校验。

liyi 1 year ago
parent
commit
92d42ebf25

+ 5 - 1
control/bootloader64k/boot/USER/main.c

@@ -605,7 +605,11 @@ int main(void)
 						break;
 					case UPGRADE_STATUS_FINISH:
 					{
-						UserJumpToApplication(start_addr);
+						
+						//jiaoyan and break
+						app1_checum = md5_check(meta_data.app1_rom_addr,meta_data.app1_size,meta_data.app1_md5);
+						if(app1_checum == 0)
+							UserJumpToApplication(start_addr);
 						
 						md_status = UPGRADE_STATUS_IDE;
 						meta_write_complete_flag = 0;   // 

+ 1 - 1
truing_control/PDU-AC_ADA_NEW_6/common/common.c

@@ -105,7 +105,7 @@ void read_config_from_eeprom(void)
 				board->con_da.row = 0;
 			}
 			board->con_da.index++;		//point next write consumer index
-			if(board->con_da.index > UINT64_MAX)
+			if(board->con_da.index >= UINT64_MAX)
 			{
 				iic_data chache1={0};
 				board->con_da.index = 0;

+ 22 - 0
truing_control/PDU-AC_ADA_NEW_6/hardware/key/key.c

@@ -1,3 +1,5 @@
+#ifndef __KEY_H_
+#define __KEY_H_
 
 
 
@@ -6,3 +8,23 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif
+
+
+
+
+
+

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

@@ -26,6 +26,10 @@
 	#if (RelaySlaveChaNum >= 3)
 		#define RELAY_3           GPIO_PIN_10
 	#endif
+
+#if SUPPORT_4_ON_FLASH
+		#define RELAY_4           GPIO_PIN_11
+#endif
 	
 	#if (RelaySlaveChaNum >= 4)
 		#define RELAY_4           GPIO_PIN_11
@@ -102,6 +106,11 @@ void relay_init(void)
 		gpio_output_options_set(RELAY_GPIO, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, RELAY_3);
 		gpio_bit_reset(RELAY_GPIO, RELAY_3);
 	#endif
+#if SUPPORT_4_ON_FLASH
+		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);
+		gpio_bit_set(RELAY_GPIO, RELAY_4);	
+#endif
 	#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);

+ 35 - 3
truing_control/PDU-AC_ADA_NEW_6/user/board_cfg.h

@@ -56,9 +56,11 @@
 #define   PRJ_3_2                   0
 #define 	PRJ_DC_8									0
 #define   PRJ_6_NEW                 0
-#define   PRJ_3_NEW                 1
-
-
+#define   PRJ_3_NEW                 0
+#define 	PRJ_5_NEW									0
+#define 	PRJ_4_SELF_LOCK       	  0
+#define   PRJ_4_BASE                0
+#define   PRJ_1_BASE                1
 
 #if PRJ_8					
 	#define   POWER_TYPE                (POWER_AC)
@@ -94,6 +96,36 @@
 	#define   PT_SUB_COUNT              (RelaySlaveChaNum)
 	#define   SUPPORT_DETECTION         1
 	#define   SUPPORT_RELAY_REMENBER		1
+	#define   SUPPORT_4_ON_FLASH        1
+#elif PRJ_5_NEW
+	#define 	RelaySlaveChaNum 					5
+	#define 	ACSingCurrid 							1 
+	#define   SURPPORT_2_PT             0
+	#define   PT_SUB_COUNT              (RelaySlaveChaNum)
+	#define   SUPPORT_DETECTION         1
+	#define   SUPPORT_RELAY_REMENBER		1
+#elif PRJ_4_SELF_LOCK
+	#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_SELF_LOCK         1
+#elif PRJ_4_BASE
+	#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
+#elif PRJ_1_BASE              
+	#define 	RelaySlaveChaNum 					1
+	#define 	ACSingCurrid 							2 
+	#define   SURPPORT_2_PT             0
+	#define   PT_SUB_COUNT              (RelaySlaveChaNum)
+	#define   SUPPORT_DETECTION         1
+	#define   SUPPORT_RELAY_REMENBER		1
 #endif
 
 

+ 1 - 1
truing_control/PDU-AC_ADA_NEW_6/user/main.c

@@ -175,7 +175,7 @@ static void task_10s(void)
 		{
 			ac_board.con_da.row = 0;
 		}
-		if(ac_board.con_da.index > UINT64_MAX)
+		if(ac_board.con_da.index >= UINT64_MAX)
 		{
 			iic_data chache1={0};
 			ac_board.con_da.index = 0;