2 Commits

Author SHA1 Message Date
2dd20fa51b Enable garabage collection 2025-05-28 21:19:56 +12:00
d33bd6b0e4 Enable watchdog timer 2025-05-28 21:17:23 +12:00

View File

@@ -51,8 +51,8 @@ async def main():
# start the server in a bacakground task # start the server in a bacakground task
print("Starting") print("Starting")
server = asyncio.create_task(w.start_server(host="0.0.0.0", port=80)) server = asyncio.create_task(w.start_server(host="0.0.0.0", port=80))
#wdt = machine.WDT(timeout=10000) wdt = machine.WDT(timeout=10000)
#wdt.feed() wdt.feed()
asyncio.create_task(wifi_connect()) asyncio.create_task(wifi_connect())
@@ -62,11 +62,10 @@ async def main():
while True: while True:
#print(time.localtime()) #print(time.localtime())
gc.collect()
# gc.collect() for i in range(20):
for i in range(60): wdt.feed()
#wdt.feed() await asyncio.sleep_ms(1000)
await asyncio.sleep_ms(500)
# cleanup before ending the application # cleanup before ending the application
await server await server