Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
103:f5d2f02dc73f | 104:22a1094545f3 |
---|---|
654 } else /* surface mode */ | 654 } else /* surface mode */ |
655 { | 655 { |
656 switch (status.base) { | 656 switch (status.base) { |
657 case BaseHome: | 657 case BaseHome: |
658 // added hw 161027 | 658 // added hw 161027 |
659 if (!(stateRealGetPointer()->warnings.lowBattery) | 659 if (!(stateRealGetPointer()->warnings.lowBattery) && (stateRealGetPointer()->lifeData.battery_charge > 9)) { |
660 && (stateRealGetPointer()->lifeData.battery_charge > 9)) { | 660 stateRealGetPointerWrite()->lastKnownBatteryPercentage =stateRealGetPointer()->lifeData.battery_charge; |
661 stateRealGetPointerWrite()->lastKnownBatteryPercentage = | 661 } else if ((wasFirmwareUpdateCheckBattery) && (timeout_in_seconds > 3)) { |
662 stateRealGetPointer()->lifeData.battery_charge; | |
663 } else if ((wasFirmwareUpdateCheckBattery) | |
664 && (timeout_in_seconds > 3)) { | |
665 wasFirmwareUpdateCheckBattery = 0; | 662 wasFirmwareUpdateCheckBattery = 0; |
666 setButtonResponsiveness( | 663 setButtonResponsiveness(settingsGetPointer()->ButtonResponsiveness); // added 170306 |
667 settingsGetPointer()->ButtonResponsiveness); // added 170306 | 664 if ((settingsGetPointer()->lastKnownBatteryPercentage > 0) && |
668 if ((settingsGetPointer()->lastKnownBatteryPercentage > 0) | 665 (settingsGetPointer()->lastKnownBatteryPercentage <= 100) && |
669 && (settingsGetPointer()->lastKnownBatteryPercentage | 666 (stateRealGetPointer()->warnings.lowBattery)) |
670 <= 100) | 667 { |
671 && (stateRealGetPointer()->warnings.lowBattery)) { | 668 // If PowerOff, and battery is <=100, and lifeData.battery_charge < 10 - ALWAYS!!! set DataOutnewBatteryGaugePercentageFloat |
672 setBatteryPercentage( | 669 // Need to fix in smallCPU handled. Compeled. |
673 settingsGetPointer()->lastKnownBatteryPercentage); | 670 //upd.Fixed. |
671 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage); | |
672 | |
674 } | 673 } |
675 } | 674 } |
676 // stuff before and new @161121 CCR-sensor limit 10 minutes | 675 // stuff before and new @161121 CCR-sensor limit 10 minutes |
677 if ((settingsGetPointer()->dive_mode == DIVEMODE_CCR) | 676 if ((settingsGetPointer()->dive_mode == DIVEMODE_CCR) |
678 && (settingsGetPointer()->CCR_Mode == CCRMODE_Sensors)) { | 677 && (settingsGetPointer()->CCR_Mode == CCRMODE_Sensors)) { |