Binary espnow_wire/espnow_transport modules plus a minimal main that broadcasts a JSON hello and polls ESP-NOW while running presets. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
444 B
Python
18 lines
444 B
Python
import asyncio
|
|
import utime
|
|
|
|
from mem_stats import print_mem
|
|
|
|
|
|
async def presets_loop(presets, wdt):
|
|
last_mem_log = utime.ticks_ms()
|
|
while True:
|
|
presets.tick()
|
|
wdt.feed()
|
|
if bool(getattr(presets, "debug", False)):
|
|
now = utime.ticks_ms()
|
|
if utime.ticks_diff(now, last_mem_log) >= 5000:
|
|
print_mem("runtime")
|
|
last_mem_log = now
|
|
await asyncio.sleep(0)
|