1 """Allows useful indirection to test Pin naming logic by switching platform in testing
2 or provide bootstrapping logic for board identification where auto-detection is not
3 feasible (e.g. multiple ESP8266 boards architecturally identical). Once runtime
4 environment is established, can choose various routes to make available and re-export
5 common modules and operations, depending on platform support
8 import adafruit_platformdetect
10 # We intentionally are patching into this namespace as module names so skip the name check.
11 # pylint: disable=invalid-name
13 # We'll define board and chip id values in agnostic rather than accessing
14 # detector directly elsewhere, just in case additional indirection is necessary
15 # at some later point:
17 detector = adafruit_platformdetect.Detector()
18 chip_id = detector.chip.id
19 board_id = detector.board.id
21 implementation = sys.implementation.name
22 if implementation == "micropython":
23 from utime import sleep
24 elif implementation in ("circuitpython", "cpython"):
25 from time import sleep