diff Discovery/Src/base.c @ 104:22a1094545f3 kittz

Tested and alive.
author Dmitry Romanov <kitt@bk.ru>
date Mon, 24 Dec 2018 16:15:02 +0300
parents 2a74647d28d1
children 3834b6272ee5
line wrap: on
line diff
--- a/Discovery/Src/base.c	Wed Nov 28 09:36:33 2018 +0300
+++ b/Discovery/Src/base.c	Mon Dec 24 16:15:02 2018 +0300
@@ -656,21 +656,20 @@
 			switch (status.base) {
 			case BaseHome:
 				// added hw 161027
-				if (!(stateRealGetPointer()->warnings.lowBattery)
-						&& (stateRealGetPointer()->lifeData.battery_charge > 9)) {
-					stateRealGetPointerWrite()->lastKnownBatteryPercentage =
-							stateRealGetPointer()->lifeData.battery_charge;
-				} else if ((wasFirmwareUpdateCheckBattery)
-						&& (timeout_in_seconds > 3)) {
+				if (!(stateRealGetPointer()->warnings.lowBattery) && (stateRealGetPointer()->lifeData.battery_charge > 9)) {
+					stateRealGetPointerWrite()->lastKnownBatteryPercentage =stateRealGetPointer()->lifeData.battery_charge;
+				} else if ((wasFirmwareUpdateCheckBattery) && (timeout_in_seconds > 3)) {
 					wasFirmwareUpdateCheckBattery = 0;
-					setButtonResponsiveness(
-							settingsGetPointer()->ButtonResponsiveness); // added 170306
-					if ((settingsGetPointer()->lastKnownBatteryPercentage > 0)
-							&& (settingsGetPointer()->lastKnownBatteryPercentage
-									<= 100)
-							&& (stateRealGetPointer()->warnings.lowBattery)) {
-						setBatteryPercentage(
-								settingsGetPointer()->lastKnownBatteryPercentage);
+					setButtonResponsiveness(settingsGetPointer()->ButtonResponsiveness); // added 170306
+					if ((settingsGetPointer()->lastKnownBatteryPercentage > 0) &&
+							(settingsGetPointer()->lastKnownBatteryPercentage <= 100) &&
+							(stateRealGetPointer()->warnings.lowBattery))
+					{
+//						If PowerOff, and battery is <=100, and lifeData.battery_charge < 10 - ALWAYS!!! set DataOutnewBatteryGaugePercentageFloat
+//						Need to fix in smallCPU handled. Compeled.
+						//upd.Fixed.
+						setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage);
+
 					}
 				}
 				// stuff before and new @161121 CCR-sensor limit 10 minutes