Selaa lähdekoodia

旧8路板将升级功能放在主函数中并使用特殊值屏蔽升级。

liyi 1 vuosi sitten
vanhempi
commit
ff68c09be5

+ 6 - 0
control/PDU-AC-COMBINE_UPGRADE/App/Main/Main.c

@@ -185,6 +185,7 @@ void switch_recode();
 #endif
 
 
+uint8_t upgreade_flag = 0;
 
 uint8_t consumer_clear_flag = 0;
 uint32_t all_val = 0;
@@ -1152,6 +1153,11 @@ int main(void)
 				sub_control();
 	#endif
 #endif
+		if(upgreade_flag)
+		{
+			upgreade_flag = 0;
+			break_2_boot_upgreade();
+		}
 		if(write_2_minute_flag == 1)
 		{
 			write_2_minute_flag = 0;

+ 2 - 2
control/PDU-AC-COMBINE_UPGRADE/App/Main/board_cfg.h

@@ -7,7 +7,7 @@
 #define 	PRJ_4_ALL_O_ALL_C					0
 #define   PRJ_4_SELF_LOCK_SWITCH    0
 #define 	PRJ_6_BASE								0
-#define 	PRJ_8_BASE								0
+#define 	PRJ_8_BASE								1
 #define   PRJ_1_ALL_O_ALL_C         0
 #define   PRJ_1_SELF_LOCK_SWITCH    0
 #define   PRJ_TWIN_FIRE             0
@@ -19,7 +19,7 @@
 #define   PRJ_7                     0
 #define   PRJ_3_ALL_O_ALL_C         0
 #define   PRJ_ONE_DE                0
-#define   PRJ_4_UNCTRL              1
+#define   PRJ_4_UNCTRL              0
 
 
 #if PRJ_4_BASE

+ 3 - 1
control/PDU-AC-COMBINE_UPGRADE/App/Modbus/BARE/port/port.c

@@ -136,6 +136,7 @@ extern AC_Ele_struct_ReadReg AC_Ele_ReadReg_All;
 extern META_DATA_S meta_data ;
 extern information_t infomation;
 
+extern uint8_t upgreade_flag ;
 
 #if SUPPORT_SELF_LOCK
  extern	uint8_t handle_k_1_status;
@@ -492,7 +493,8 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi
 							AT24CxxWrite(Eepr_AC_Sing_All_Over_SmaAddr,Eeprom_Wbuf,2);
 						}else if(AC_Sing_Break_Upgrade == usAddress)
 						{
-							break_2_boot_upgreade();
+							if(usRegHoldBuf[WiRegIndex] == 0XA5A5)
+								upgreade_flag = 1;
 						}
         }
     }