Enable watchdog timer
This commit is contained in:
parent
8902adf18c
commit
d33bd6b0e4
12
src/main.py
12
src/main.py
|
@ -51,8 +51,8 @@ async def main():
|
|||
# start the server in a bacakground task
|
||||
print("Starting")
|
||||
server = asyncio.create_task(w.start_server(host="0.0.0.0", port=80))
|
||||
#wdt = machine.WDT(timeout=10000)
|
||||
#wdt.feed()
|
||||
wdt = machine.WDT(timeout=10000)
|
||||
wdt.feed()
|
||||
|
||||
|
||||
asyncio.create_task(wifi_connect())
|
||||
|
@ -63,10 +63,10 @@ async def main():
|
|||
|
||||
#print(time.localtime())
|
||||
|
||||
# gc.collect()
|
||||
for i in range(60):
|
||||
#wdt.feed()
|
||||
await asyncio.sleep_ms(500)
|
||||
#gc.collect()
|
||||
for i in range(20):
|
||||
wdt.feed()
|
||||
await asyncio.sleep_ms(1000)
|
||||
|
||||
# cleanup before ending the application
|
||||
await server
|
||||
|
|
Loading…
Reference in New Issue