Browse Source

Fix voltage value in Stop mode.

Vladimir N. Shilov 2 years ago
parent
commit
0dc9e4cd04
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main.c

+ 2 - 1
src/main.c

@@ -544,6 +544,7 @@ static void prepare_Screen(void) {
 
   /* clear bootom area */
   gdispFillStringBox(1, 123, 318, 115, " ", font2, Red, Gray, gJustifyLeft);
+  gdispFillStringBox(1, 213, 318, 29, "Stop", font2, Red, Silver, gJustifyCenter);
 
   /* create the console window */
   {
@@ -738,7 +739,7 @@ static void ina_Process(void) {
         chEvtBroadcast(&ina_all_event);
       } else {
       /* Show bus voltage in STOP mode */
-        Voltage = sumVoltage;
+        Voltage = (sumVoltage + (INA_AVG_FACTOR/2)) / INA_AVG_FACTOR;
         sumCurrent=0;
         sumVoltage=0;