From ebd564d6aea7704a2fd6e2635f49cf7a6795d85d Mon Sep 17 00:00:00 2001 From: Cefn Hoile Date: Tue, 20 Feb 2018 17:09:51 +0000 Subject: [PATCH] Reversed mistakenly committed tweak. Introduced conservative garbage collection to minimise heap fragmentation --- python/agnostic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/agnostic.py b/python/agnostic.py index 167b4d6..154360a 100644 --- a/python/agnostic.py +++ b/python/agnostic.py @@ -4,7 +4,9 @@ environment is established, can choose various routes to make available and re-export common modules and operations, depending on platform support """ +import gc import sys +gc.collect() try: microcontroller = sys.platform @@ -24,6 +26,7 @@ else: implementation = sys.implementation.name if implementation == "micropython": - from utime import sleep, time + from utime import sleep elif implementation == "circuitpython": - from time import sleep, time + from time import sleep +gc.collect() -- 2.49.0