add sleep.wfi()

Change ```time.sleep(0.01)``` to ```sleep.wfi()``` to save battery power when sleep.wfi() is fixed.  Ironically, this change will increase battery load until sleep.wfi() is implemented properly.  But it is in line with the instructions here 69c7cd39b5/lib/homescreen.py (L9)
tildatorch
Steveis 2018-08-29 08:07:51 +01:00 committed by GitHub
parent 6cd5d3e16b
commit 258aab08a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2,11 +2,11 @@
___name___ = "Sponsors"
___license___ = "MIT"
___dependencies___ = ["wifi", "http", "ugfx_helper"]
___dependencies___ = ["wifi", "http", "ugfx_helper", "sleep"]
___categories___ = ["EMF"]
___bootstrapped___ = True
import ugfx_helper, os, wifi, ugfx, http, time
import ugfx_helper, os, wifi, ugfx, http, time, sleep
from tilda import Buttons
ugfx_helper.init()
@ -21,6 +21,6 @@ except:
ugfx.text(5, 5, "Couldn't download sponsors", ugfx.BLACK)
while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)):
time.sleep(0.01)
sleep.wfi()
ugfx.clear()