X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/849802422e7ffbe0f097239649f2a0d62d8acbfd..ef9e1aa6b026f4f309c00f10002382701e9a2c1c:/python/agnostic.py diff --git a/python/agnostic.py b/python/agnostic.py index 1d0881d..67b42e6 100644 --- a/python/agnostic.py +++ b/python/agnostic.py @@ -4,27 +4,28 @@ 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 except: microcontroller = None -# TODO switch name of platform below to be microcontroller +board = None if microcontroller is not None: - if microcontroller == "esp8266": + if microcontroller == "esp8266": # TODO more conservative board-guessing board = "feather_huzzah" elif microcontroller == "samd21": - board="feather_m0_express" + board = "feather_m0_express" elif microcontroller == "pyboard": - microcontroller= "stm32" - board="pyboard" -else: - board = None + microcontroller = "stm32" + board = "pyboard" implementation = sys.implementation.name if implementation == "micropython": - import utime as time + from utime import sleep elif implementation == "circuitpython": - import time \ No newline at end of file + from time import sleep +gc.collect() \ No newline at end of file