File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -434,13 +434,13 @@ void WatchFaceInfineat::Refresh() {
434
434
435
435
batteryPercentRemaining = batteryController.PercentRemaining ();
436
436
isCharging = batteryController.IsCharging ();
437
- if (batteryController.IsCharging () && (uint32_t ( lv_tick_get ( ) - savedAnimationTick) > 150 )) { // Charging battery animation
438
- chargingBatteryPercent += 3 ; // 100% / pine_small height = 3
437
+ if (batteryController.IsCharging () && (xTaskGetTickCount ( ) - chargingAnimationTick > pdMS_TO_TICKS ( 150 ) )) { // Charging battery animation
438
+ chargingBatteryPercent += 100 / lv_obj_get_height (logoPine);
439
439
if (chargingBatteryPercent > 100 ) {
440
440
chargingBatteryPercent = batteryPercentRemaining.Get ();
441
441
}
442
442
SetBatteryLevel (chargingBatteryPercent);
443
- savedAnimationTick = lv_tick_get ();
443
+ chargingAnimationTick = xTaskGetTickCount ();
444
444
} else if (isCharging.IsUpdated () || batteryPercentRemaining.IsUpdated ()) {
445
445
chargingBatteryPercent = batteryPercentRemaining.Get ();
446
446
SetBatteryLevel (chargingBatteryPercent);
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ namespace Pinetime {
46
46
47
47
private:
48
48
uint32_t savedTick = 0 ;
49
- uint32_t savedAnimationTick = 0 ;
50
49
uint8_t chargingBatteryPercent = 101 ; // not a mistake ;)
50
+ TickType_t chargingAnimationTick = 0 ;
51
51
52
52
Utility::DirtyValue<uint8_t > batteryPercentRemaining {};
53
53
Utility::DirtyValue<bool > isCharging {};
You can’t perform that action at this time.
0 commit comments