Fix bug in EPD wait method.

pull/8/head
Peter Hinch 2021-01-24 10:37:56 +00:00
rodzic 158358a713
commit 7604c1cd64
3 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -131,6 +131,7 @@ class EPD(framebuf.FrameBuffer):
print('wait_until_ready {}ms {:5.1f}mins'.format(dt, dt/60_000))
async def wait(self):
await asyncio.sleep_ms(0) # Ensure tasks run that might make it unready
while not self.ready():
await asyncio.sleep_ms(100)

Wyświetl plik

@ -109,17 +109,14 @@ class EPD(framebuf.FrameBuffer):
print('Init Done.')
# For use in synchronous code: blocking wait on ready state.
# TODO remove debug code from Waveshare fiasco.
def wait_until_ready(self):
sleep_ms(50)
t = ticks_ms()
while not self.ready():
sleep_ms(100)
dt = ticks_diff(ticks_ms(), t)
print('wait_until_ready {}ms {:5.1f}mins'.format(dt, dt/60_000))
# Asynchronous wait on ready state. Pause (4.9s) for physical refresh.
async def wait(self):
await asyncio.sleep_ms(0) # Ensure tasks run that might make it unready
while not self.ready():
await asyncio.sleep_ms(100)

Wyświetl plik

@ -31,7 +31,7 @@ def xorshift64star(modulo, seed = 0xf9ac6ba4):
return (x * 0x2545F4914F6CDD1D) % modulo
return func
async def compass(evt): # TODO why does this not get drawn on 1st pass?
async def compass(evt):
wri = Writer(ssd, arial10, verbose=False)
wri.set_clip(False, False, False)
v1 = 0 + 0.9j
@ -42,7 +42,6 @@ async def compass(evt): # TODO why does this not get drawn on 1st pass?
while True:
ptr.value(v1)
v1 *= v2
# await asyncio.sleep_ms(100)
await evt.wait()