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

Commit 13740c0

Browse files
committed
Reset countdown on interaction
1 parent 264fc70 commit 13740c0

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

esp32/modules/splash.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,12 @@ def start_ota(pushed):
277277
if(pushed):
278278
print("[SPLASH] Starting OTA...")
279279
appglue.start_ota()
280-
280+
281+
# NOTHING
282+
def nothing(pressed):
283+
if (pressed):
284+
reset_countdown()
285+
281286
# MAGIC
282287
def actually_start_magic():
283288
print("[SPLASH] Starting magic...")
@@ -286,6 +291,7 @@ def actually_start_magic():
286291

287292
magic = 0
288293
def start_magic(pushed):
294+
reset_countdown()
289295
global magic
290296
if(pushed):
291297
magic = magic + 1
@@ -312,7 +318,7 @@ def badge_sleep_forever():
312318
def splashTimer_callback(tmr):
313319
global loopCnt
314320
global timer_loop_amount
315-
#print("[TIMER] "+str(loopCnt))
321+
print("[TIMER] "+str(loopCnt))
316322
if loopCnt<1:
317323
loopCnt = timer_loop_amount
318324
cstate = badge.battery_charge_status()
@@ -338,6 +344,11 @@ def splashTimer_callback(tmr):
338344
if (loop_services(loopCnt)):
339345
loopCnt = timer_loop_amount
340346
loopCnt = loopCnt - 1
347+
348+
def reset_countdown():
349+
global loopCnt
350+
global timer_loop_amount
351+
loopCnt = timer_loop_amount
341352

342353
def start_sleep_counter():
343354
global splashTimer
@@ -497,6 +508,12 @@ def splash_main():
497508
welcome()
498509
ugfx.input_attach(ugfx.BTN_START, start_launcher)
499510
ugfx.input_attach(ugfx.BTN_A, start_magic)
511+
ugfx.input_attach(ugfx.BTN_B, nothing)
512+
ugfx.input_attach(ugfx.BTN_SELECT, nothing)
513+
ugfx.input_attach(ugfx.JOY_UP, nothing)
514+
ugfx.input_attach(ugfx.JOY_DOWN, nothing)
515+
ugfx.input_attach(ugfx.JOY_LEFT, nothing)
516+
ugfx.input_attach(ugfx.JOY_RIGHT, nothing)
500517
global splashTimer
501518
setup_services()
502519
start_sleep_counter()
@@ -527,7 +544,7 @@ def splash_main():
527544
splash_timer_interval = 500
528545

529546
update_available = False
530-
update_name = "BIG FAT ERROR"
547+
update_name = "????"
531548
update_build = 0
532549

533550
splash_main()

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