]> Repositories - Adafruit_Blinka-hackapet.git/blob - python/agnostic.py
Commented
[Adafruit_Blinka-hackapet.git] / python / agnostic.py
1 """Allows useful indirection to test Pin naming logic by switching platform in testing
2     or where auto-detection is not feasible (e.g. multiple ESP8266 boards architecturally identical)
3 """
4 import sys
5
6 try:
7     platform = sys.platform
8 except:
9     platform = None
10
11 if platform is not None:
12     if platform == "esp8266":
13         board = "huzzah"
14     elif platform == "Atmel SAMD21":
15         board="feather_m0_express"
16     elif platform == "pyboard":
17         platform="STM32F405RG"
18         board="pyboard"
19 else:
20     board = None
21
22 implementation = sys.implementation.name
23 if implementation == "micropython":
24     import utime as time
25 elif implementation == "circuitpython":
26     import time