Explorar o código

合入状态时间获取功能

yidong hai 1 mes
pai
achega
de98101dc7

+ 2 - 0
BoardInterface/onechip_devinf_define.h

@@ -103,6 +103,8 @@ typedef struct {
 	void * beep_port;	
 	uint8_t amplifState;
 	uint8_t lysisState;
+	uint32_t amplifStateTime;
+	uint32_t lysisStateTime;
 	uint8_t updateSt;
 	uint8_t amplif_error_code; //错误码 
 	uint8_t lysis_error_code; //错误码 

+ 1 - 1
BoardInterface/onechip_load_inf.h

@@ -8,7 +8,7 @@
 #define SOFT_VERSION_1  7	//软件版本号
 #define SOFT_VERSION_2  4	//软件版本号
 #define SOFT_VERSION_3  0	//软件版本号
-#define SOFT_VERSION_4  19	//软件版本号
+#define SOFT_VERSION_4  20	//软件版本号
 
 
 

+ 2 - 0
Core/Src/main.c

@@ -279,6 +279,8 @@ int main(void)
       if(sysinf.error_delay){
         sysinf.error_delay--;
       }
+      sysinf.amplifStateTime++;
+      sysinf.lysisStateTime++;
 		}
     if(sysinf.resendFlag == 1 ){
       sysinf.resendFlag  = 0; 

+ 2 - 0
DriverInterface/communication.c

@@ -385,6 +385,8 @@ int AskState_response(CmdMessage *pMsg, unsigned char result)
         stateinfDef st;
         st.amplifState =sysinf.amplifState;
         st.lysisState =sysinf.lysisState;
+        st.amplifStateTime =sysinf.amplifStateTime;
+        st.lysisStateTime =sysinf.lysisStateTime;
         memcpy(st.SN, &sysinf.SN, 7);
 
    	data_send_to_pc(PC_CMD_ASKSTATE, (char *)&st, sizeof(stateinfDef));  

+ 4 - 1
DriverInterface/communication.h

@@ -72,7 +72,10 @@ typedef struct _sysinf
 	unsigned char SN[8];
 	unsigned char amplifState;
 	unsigned char lysisState;
-  unsigned char updateSt;
+  	unsigned char updateSt;
+	unsigned char res;
+	unsigned int amplifStateTime;
+	unsigned int lysisStateTime;
 }stateinfDef;
 #define MSG_CMDFRAME_LEN (6)
 typedef struct 

+ 2 - 0
DriverInterface/state_mini.c

@@ -278,6 +278,7 @@ void re_send_state(void){
 void updateAmplifState(uint8_t newset){
     if(sysinf.amplifState != newset){
         sysinf.amplifState = newset;
+        sysinf.amplifStateTime = 0; 
         if(newset == SYS_STATE_ERROR_HW){
             sysinf.lysisState = newset;
             beep_set(BEEP_ERR_HW);
@@ -291,6 +292,7 @@ void updateAmplifState(uint8_t newset){
 void updateLysisState(uint8_t newset){
     if(sysinf.lysisState != newset){
         sysinf.lysisState = newset;
+        sysinf.lysisStateTime = 0; 
         if(newset == SYS_STATE_ERROR_HW){
             sysinf.amplifState = newset;
             beep_set(BEEP_ERR_HW);