Revert unnecessary changes
parent
f2de291d9e
commit
6cae17d3bb
14
lib/sleep.py
14
lib/sleep.py
|
@ -2,14 +2,16 @@
|
|||
|
||||
___license___ = "MIT"
|
||||
|
||||
import utime
|
||||
import time
|
||||
|
||||
def sleep_ms(duration):
|
||||
utime.sleep_ms(duration)
|
||||
# todo: deepsleep?
|
||||
time.sleep_ms(duration)
|
||||
|
||||
def sleep(duration):
|
||||
utime.sleep(duration)
|
||||
# todo: deepsleep?
|
||||
time.sleep(duration)
|
||||
|
||||
def wfi(duration):
|
||||
#todo: this is fake
|
||||
sleep_ms(duration)
|
||||
def wfi():
|
||||
# todo: this is fake
|
||||
sleep_ms(1)
|
||||
|
|
|
@ -76,7 +76,11 @@ def connect_wifi(details, timeout, wait=False):
|
|||
nic().connect(details['ssid'])
|
||||
|
||||
if wait:
|
||||
wait_until = time.ticks_ms() + timeout * 1000
|
||||
while not nic().isconnected():
|
||||
#nic().update() # todo: do we need this?
|
||||
if (time.ticks_ms() > wait_until):
|
||||
raise OSError("Timeout while trying to connect to wifi")
|
||||
sleep.sleep_ms(100)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue