Browse Source

1.解决告警报错问题
2.解决断网,数据丢失一帧问题

yidong 1 month ago
parent
commit
b97114edd1
3 changed files with 25 additions and 8 deletions
  1. 7 7
      DriverInterface/state_mini.c
  2. 2 1
      DriverInterface/usr_motor.c
  3. 16 0
      MDK-ARM/mini7_V2.uvoptx

+ 7 - 7
DriverInterface/state_mini.c

@@ -305,13 +305,11 @@ void updateAmplifState(uint8_t newset,uint8_t id){
     if(id==0){
         if(sysinf.amplifState != newset){
             sysinf.amplifState = newset;
-            if(newset == SYS_STATE_ERROR_HW){
-                sysinf.lysisState = newset;
-                
+            if(newset == SYS_STATE_ERROR_HW){                
 #ifdef ONECHIP_MINI_ONE
-                beep_set(BEEP_ERR_HW);
+                sysinf.lysisState = newset;
 #endif
-                
+            beep_set(BEEP_ERR_HW);
             }else if(newset == SYS_STATE_ERROR_HM){
                 beep_set(BEEP_ERR_HM);
             }
@@ -320,8 +318,10 @@ void updateAmplifState(uint8_t newset,uint8_t id){
     }else{
         if(sysinf.lysisState != newset){
             sysinf.lysisState = newset;
-            if(newset == SYS_STATE_ERROR_HW){
+            if(newset == SYS_STATE_ERROR_HW){              
+#ifdef ONECHIP_MINI_ONE
                 sysinf.lysisState = newset;
+#endif
                 beep_set(BEEP_ERR_HW);
             }else if(newset == SYS_STATE_ERROR_HM){
                 beep_set(BEEP_ERR_HM);
@@ -536,7 +536,7 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
 
             //上报采样数据
 //            sample_send_rt_data();
-			if(((sts->DataSendLast+ 1)%MAX_DATA_BUF_SIZE) != sts->DataSendHeader){
+			if(sts->DataSendLast < MAX_DATA_BUF_SIZE){
 				for (int i = 0; i < CS_MAX; i++)
 				{
 					// === 打桩测试模式 (Stub Test) ===

+ 2 - 1
DriverInterface/usr_motor.c

@@ -532,7 +532,8 @@ uint32_t Motor_mix_work(void) {
   		/*电机不动,返回报错*/
   		SetMotorPwm(MOTOR_REV, 0);
   		sw_st = SWING_ERR;
-		error_set(ERROR_MOTOR_FIALED,0);		
+		error_set(ERROR_MOTOR_FIALED,0);	
+		error_set(ERROR_MOTOR_FIALED,1);		
         updateAmplifState(SYS_STATE_ERROR_HW,0);
         updateAmplifState(SYS_STATE_ERROR_HW,1);
   		return 1;

+ 16 - 0
MDK-ARM/mini7_V2.uvoptx

@@ -647,6 +647,22 @@
           <ExecCommand></ExecCommand>
           <Expression></Expression>
         </Bp>
+        <Bp>
+          <Number>7</Number>
+          <Type>0</Type>
+          <LineNumber>862</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>0</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>0</BreakIfRCount>
+          <Filename>..\DriverInterface\ESP32_WROOM_32D.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression></Expression>
+        </Bp>
       </Breakpoint>
       <WatchWindow1>
         <Ww>