Browse Source

1.直采温度延时改为200ms
2.bcu 调用延时逻辑修改

LAPTOP-EG88H5BE\86151 3 years ago
parent
commit
0a226d0573
4 changed files with 27 additions and 23 deletions
  1. 6 18
      src/AppTaskControl.c
  2. 1 1
      src/AppTaskUart.c
  3. 16 1
      src/EmbeddedCoder_src/BCU.c
  4. 4 3
      src/EmbeddedCoder_src/SFM.c

+ 6 - 18
src/AppTaskControl.c

@@ -20,7 +20,6 @@ static void ControlTask(void *arg)
     UINT32 param;
     PROC_CONTROL_STATE_SWITCH(PROCESS_CONTROL_STATE_IDLE);
     UINT32 CurrentTime = 0;
-    UINT8 AdcOrder = 1;
     UINT16 RingTimes = 0;
     while (true)
     {
@@ -78,12 +77,7 @@ static void ControlTask(void *arg)
             }
             if (TimeCounter % 10 == 0)
             {
-                GetAdcValue(AdcOrder);
-                AdcOrder++;
-                if (AdcOrder > 5)
-                {
-                    AdcOrder = 1;
-                }
+                GetAdcValue(1);
             }
             if (gProcess_app != WORK)
             {
@@ -104,12 +98,7 @@ static void ControlTask(void *arg)
             osDelay(100);
             if (TimeCounter % (10 * 600) == 0)
             {
-                GetAdcValue(AdcOrder);
-                AdcOrder++;
-                if (AdcOrder > 5)
-                {
-                    AdcOrder = 1;
-                }
+                GetAdcValue(1);
             }
             if (gProcess_app == WORK)
             {
@@ -146,23 +135,22 @@ void GetAdcValue(UINT8 num)
     case FAST_CHARGE_TEMP:
         NB_ADC_Get(&adcValue, FAST_CHARGE_TEMP);
         fastChargeTemp = LookUpRTtable(adcValue);
-        break;
+		osDelay(200);
     case NORMAL_CHARGE_TEMP:
         NB_ADC_Get(&adcValue, NORMAL_CHARGE_TEMP);
         normalChargeTemp = LookUpRTtable(adcValue);
-        break;
+		osDelay(200);
     case OTHER_TEMP_1:
         NB_ADC_Get(&adcValue, OTHER_TEMP_1);
         heatTemp1 = LookUpRTtable(adcValue);
-        break;
+		osDelay(200);
     case OTHER_TEMP_2:
         NB_ADC_Get(&adcValue, OTHER_TEMP_2);
         heatTemp2 = LookUpRTtable(adcValue);
-        break;
+		osDelay(200);
     case VBAT:
         NB_ADC_Get(&adcValue, VBAT);
         PowerVoltage = adcValue;
-        break;
     default:
         break;
     }

+ 1 - 1
src/AppTaskUart.c

@@ -146,10 +146,10 @@ static void UartTask(void *arg)
 #endif
 			if (Uart_Recv_LEN > 5)
 			{
+			    uartBattInfoDecode(UartAnswerData.data);
 				UartErrorFlag = 0;
 				UartRecvFlagCounter = 0;
 				UartRecvFlag = 1;
-				uartBattInfoDecode(UartAnswerData.data);
 				PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
 				break;
 			}

+ 16 - 1
src/EmbeddedCoder_src/BCU.c

@@ -13,7 +13,22 @@ static process_Bcu gProcess_Bcu_Task;
 void BCU(void)
 {
     uint16_T i;
-    osDelay(5000);
+    uint16_T RecvCounter = 0;
+    while (TRUE)
+    {
+        if (UartRecvFlag == 1 || RecvCounter >= 15)
+        {   
+            //osDelay(1000);
+            break;
+        }
+        else
+        {
+            RecvCounter++;
+            osDelay(1000);
+        }
+		//printf("RecvCounter:%d\n ",RecvCounter);
+    }
+	
     PROC_BCU_STATE_SWITCH(PROCESS_STATE_INIT);
     while (TRUE)
     {

+ 4 - 3
src/EmbeddedCoder_src/SFM.c

@@ -1711,13 +1711,14 @@ void SFM(void)
         sfmd_st_fltAct = sfmd_st_fltAct | FltActArr[i];
     }
 
-    for(i=0;i < 20;i++)
+     
+   /*  for(i=0;i < 20;i++)
      {
          printf("%d  ",sfmv_idx_fltCode[i]);
      }
      printf("\n");
-    //printf("sfmd_st_fltAct:%d,sfmd_st_fltLevel:%d\n\n", sfmd_st_fltAct, sfmd_st_fltLevel);
-
+    
+*/
     ///=====================================================================
     //======================================================================