Skip to content

Updated 96 Boards detection to be more specific #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
ODROID_C2 = "ODROID_C2"

FTDI_FT232H = "FT232H"
LINARO_96BOARDS = "LINARO_96BOARDS"
DRAGONBOARD_410C = "DRAGONBOARD_410C"
# pylint: enable=bad-whitespace

#OrangePI
Expand Down Expand Up @@ -113,6 +113,10 @@
OSD3358_SM_RED,
)

_LINARO_96BOARDS_IDS = (
DRAGONBOARD_410C,
)

# BeagleBone eeprom board ids from:
# https://github.com/beagleboard/image-builder
# Thanks to zmatt on freenode #beagle for pointers.
Expand Down Expand Up @@ -291,7 +295,7 @@ def id(self):
elif chip_id == ap_chip.FT232H:
board_id = FTDI_FT232H
elif chip_id == ap_chip.APQ8016:
board_id = LINARO_96BOARDS
board_id = DRAGONBOARD_410C
elif chip_id in (ap_chip.T210, ap_chip.T186, ap_chip.T194):
board_id = self._tegra_id()
return board_id
Expand Down Expand Up @@ -378,12 +382,8 @@ def _tegra_id(self):

@property
def any_96boards(self):
"""Check if the current board is any 96Boards-family board."""
return (
self.detector.check_dt_compatible_value("qcom,apq8016-sbc")
or self.detector.check_dt_compatible_value("hisilicon,hi3660-hikey960")
or self.detector.check_dt_compatible_value("hisilicon,hi6220-hikey")
)
"""Check whether the current board is any 96boards board."""
return self.id in _LINARO_96BOARDS_IDS

@property
def any_raspberry_pi(self):
Expand Down
2 changes: 1 addition & 1 deletion bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

print("Board id: ", detector.board.id)

print("Is this a 96Boards board?", detector.board.LINARO_96BOARDS)
print("Is this a DragonBoard 410c?", detector.board.DRAGONBOARD_410C)
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
print("Is this a BBB?", detector.board.BEAGLEBONE_BLACK)
Expand Down