Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 9026219

Browse files
committed
[splash] Determine battery status after loading settings
Because the settings influence how the battery percentage is calculated.
1 parent 3880413 commit 9026219

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

esp32/modules/splash.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,19 +489,21 @@ def load_settings():
489489
timer_loop_amount = badge.nvs_get_u8('splash', 'timer.amount', 25)
490490
global loopCnt
491491
loopCnt = timer_loop_amount
492-
492+
493493
# MAIN
494-
def splash_main():
494+
def splash_main():
495495
cstate = badge.battery_charge_status()
496-
percent = battery_percent()
497-
vbatt = badge.battery_volt_sense()
498-
print("[SPLASH] Vbatt = "+str(vbatt))
499496
load_settings()
500-
497+
501498
global header_status_string
502499
header_status_string = ""
503-
500+
504501
ugfx.init()
502+
503+
percent = battery_percent()
504+
vbatt = badge.battery_volt_sense()
505+
print("[SPLASH] Vbatt = "+str(vbatt))
506+
505507
global battery_percent_empty
506508
if (cstate) or (percent>battery_percent_empty) or (vbatt<100):
507509
ugfx.input_init()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy