Browse Source

small changes by Simon

simon bischof 7 years ago
parent
commit
801f973386
2 changed files with 4 additions and 4 deletions
  1. 3 3
      ProjectSource/BMS_UI_v4/BMS_UI_Main.c
  2. 1 1
      ProjectSource/BMS_UI_v4/BMS_UI_Measure.c

+ 3 - 3
ProjectSource/BMS_UI_v4/BMS_UI_Main.c

@@ -266,7 +266,7 @@ void main(void)
                 // If current offset exceeds the limit --> Error currenrsense dysfunction
                 if( (gOffsetCurrent > ERROR_OFFSET_p) | (gOffsetCurrent < ERROR_OFFSET_n) )
                 {
-                    UI_ERROR = OFFSET_ERROR;
+                    UI_ERROR |= OFFSET_ERROR;
                     UIMode = ERROR_MODE;
                 }
 
@@ -277,7 +277,7 @@ void main(void)
 
                     if( (adc_value > SUPPLY_MAX) | (adc_value < SUPPLY_MIN) )
                     {
-                        UI_ERROR = SUPPLY_ERROR;
+                        UI_ERROR |= SUPPLY_ERROR;
                         UIMode = ERROR_MODE;
                     }
 
@@ -353,7 +353,7 @@ void main(void)
             }
 
             // No response from Master
-            if(timeout_cnt > (300+t_POWER_PIN))    //after 30 sec POWER OFF activated
+            if(timeout_cnt > (3000+t_POWER_PIN))    //after 300 sec POWER OFF activated
             {
                 t_POWER_PIN++;
                 LATCbits.LATC6   ^= 1;

+ 1 - 1
ProjectSource/BMS_UI_v4/BMS_UI_Measure.c

@@ -54,7 +54,7 @@ uint16_t Measure( void )
    else
    {
        gCurrent = CurrentOverS;
-       gCurrent = (gCurrent + past_Current) >> 1;      // Divide by 2 to calculate the mean current
+       gCurrent = (gCurrent + past_Current) / 2;      // Divide by 2 to calculate the mean current
    }
 
    VoltageOverS = VoltageOverS >> 6;        //Divide 2^6 = 64