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
 
   9 # We intentionally are patching into this namespace as module names so skip the name check.
 
  10 # pylint: disable=invalid-name
 
  11 platform = sys.platform
 
  15 if platform is not None:
 
  16     if platform == "esp8266":  # TODO more conservative board-guessing
 
  17         board_id = "feather_huzzah"
 
  18     elif platform == "samd21":
 
  19         board_id = "feather_m0_express"
 
  20     elif platform == "pyboard":
 
  23     elif platform == "linux":
 
  24         from Adafruit_GPIO import Platform
 
  25         if Platform.platform_detect() == Platform.RASPBERRY_PI:
 
  26             if Platform.pi_version() == 1:
 
  28             elif Platform.pi_version() == 2:
 
  30             elif Platform.pi_version() == 3:
 
  32         elif Platform.platform_detect() == Platform.BEAGLEBONE_BLACK:
 
  33             board_id = "beaglebone_black"
 
  35 implementation = sys.implementation.name
 
  36 if implementation == "micropython":
 
  37     from utime import sleep
 
  38 elif implementation == "circuitpython" or implementation == "cpython":
 
  39     from time import sleep