"""
`board` - Define ids for available pins
=================================================
-Conditionally imports and re-exports a submodule, such as boards.esp8266 based on
-platform introspection
+
+See `CircuitPython:board` in CircuitPython for more details.
* Author(s): cefn
"""
+import sys
+
+from adafruit_blinka.agnostic import board_id
+import adafruit_platformdetect.board as ap_board
-import gc
-gc.collect()
-from adafruit_blinka.agnostic import board
-gc.collect()
+# pylint: disable=wildcard-import,unused-wildcard-import,ungrouped-imports
-if board == "feather_huzzah":
+if board_id == ap_board.FEATHER_HUZZAH:
from adafruit_blinka.board.feather_huzzah import *
-elif board == "nodemcu":
+
+elif board_id == ap_board.NODEMCU:
from adafruit_blinka.board.nodemcu import *
-elif board == "pyboard":
+
+elif board_id == ap_board.PYBOARD:
from adafruit_blinka.board.pyboard import *
+
+elif board_id in ap_board.ANY_RASPBERRY_PI_40PIN:
+ from adafruit_blinka.board.raspi_23 import *
+
+elif board_id == ap_board.BEAGLEBONE_BLACK:
+ from adafruit_blinka.board.beaglebone_black import *
+
+elif board_id == ap_board.ORANGE_PI_PC:
+ from adafruit_blinka.board.orangepipc import *
+
+elif "sphinx" in sys.modules:
+ pass
+
else:
raise NotImplementedError("Board not supported")
-gc.collect()