actual runnable demo on esp32-s3-eye

This commit is contained in:
Jeff Epler 2022-10-23 12:06:33 -05:00
parent 2a6e706c2c
commit f44b216d03
No known key found for this signature in database
GPG key ID: D5BF15AB975AB4DE

26
py/do_coproc.py Normal file
View file

@ -0,0 +1,26 @@
import time
import struct
from coproc import *
from minidump import e, h, en
def storele32(cm, off, x):
print(off, ":=", x)
cm[off:off+4] = struct.pack("<l", x)
def storele16(cm, off, x):
print(off, ":=", x)
cm[off:off+2] = struct.pack("<h", x)
binary = e._readat(h.p_offset, h.p_filesz)
cm = CoprocMemory(0x50000000, 8176)
off = en.st_value
print(f"value at {off}, adjusted offset is {off}")
c = Coproc(binary)
try:
run(c)
while True:
cm[off] = 10
time.sleep(2)
cm[off] = 20
time.sleep(2)
finally:
halt(c)