kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
Merge pull request #21 from ThinkTransit/gc-threshold
gc.threshold() not available on all portsencoder_driver
commit
5bc33d0b2a
|
@ -536,6 +536,7 @@ class Screen:
|
||||||
while Screen.do_gc:
|
while Screen.do_gc:
|
||||||
await asyncio.sleep_ms(500)
|
await asyncio.sleep_ms(500)
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
if hasattr(gc, 'threshold'):
|
||||||
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
|
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
|
||||||
n += 1
|
n += 1
|
||||||
n &= 0x1F
|
n &= 0x1F
|
||||||
|
|
Ładowanie…
Reference in New Issue