From 15a7d4b99b86d03fb45b6c30ce1c6925b3b624bd Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Thu, 20 Jun 2019 10:10:06 -0700 Subject: [PATCH 1/2] Updated 96 Boards detection to be more specific --- adafruit_platformdetect/board.py | 15 +++++++-------- bin/detect.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 88802ce3..aea73d00 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -58,7 +58,7 @@ ODROID_C2 = "ODROID_C2" FTDI_FT232H = "FT232H" -LINARO_96BOARDS = "LINARO_96BOARDS" +DRAGONBOARD_410C = "DRAGONBOARD_410C" # pylint: enable=bad-whitespace #OrangePI @@ -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. @@ -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 @@ -378,12 +382,7 @@ 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") - ) + return self.id in _LINARO_96BOARDS_IDS @property def any_raspberry_pi(self): diff --git a/bin/detect.py b/bin/detect.py index 3f8c47d1..7efb9ed7 100755 --- a/bin/detect.py +++ b/bin/detect.py @@ -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) From 47aa164ec8db5187fa05562b9f78d4d19e84dddd Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Thu, 20 Jun 2019 10:13:24 -0700 Subject: [PATCH 2/2] Linting --- adafruit_platformdetect/board.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index aea73d00..bda63346 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -382,6 +382,7 @@ def _tegra_id(self): @property def any_96boards(self): + """Check whether the current board is any 96boards board.""" return self.id in _LINARO_96BOARDS_IDS @property