From 0ca46b643c654719eafc7ec5d41054c0cc04f89c Mon Sep 17 00:00:00 2001 From: PleahMaCaka Date: Fri, 26 Sep 2025 14:16:05 +0800 Subject: [PATCH] Added support for D-Robotics RDK-X5 --- adafruit_platformdetect/board.py | 2 ++ adafruit_platformdetect/chip.py | 3 +++ adafruit_platformdetect/constants/boards.py | 3 ++- adafruit_platformdetect/constants/chips.py | 1 + bin/detect.py | 3 +++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 1136ad56..303fd36b 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -243,6 +243,8 @@ def id(self) -> Optional[str]: board_id = self._rv1106_id() elif chip_id == chips.SUNRISE_X3: board_id = boards.RDK_X3 + elif chip_id == chips.SUNRISE_X5: + board_id = boards.RDK_X5 elif chip_id == chips.QCM6490: board_id = boards.PARTICLE_TACHYON self._board_id = board_id diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 2cdc5db1..ce8b0980 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -349,6 +349,9 @@ def _linux_id(self) -> Optional[str]: if self.detector.check_dt_compatible_value("hobot,x3"): return chips.SUNRISE_X3 + if self.detector.check_dt_compatible_value("Horizon, x5"): + return chips.SUNRISE_X5 + if self.detector.check_dt_compatible_value("particle,tachyon"): return chips.QCM6490 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index c5cadfac..e8cfae81 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -270,6 +270,7 @@ # Horizon RDK_X3 = "RDK_X3" +RDK_X5 = "RDK_X5" # Particle PARTICLE_TACHYON = "PARTICLE_TACHYON" @@ -702,7 +703,7 @@ ) # Horizon -_HORIZON_IDS = (RDK_X3,) +_HORIZON_IDS = (RDK_X3, RDK_X5) _AMERIDROID_IDS = (INDIEDROID_NOVA,) diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index 5b692885..36a6a4c4 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -88,6 +88,7 @@ RZV2N = "RZV2N" RZV2H = "RZV2H" SUNRISE_X3 = "SUNRISE_X3" +SUNRISE_X5 = "SUNRISE_X5" QCM6490 = "QCM6490" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"} diff --git a/bin/detect.py b/bin/detect.py index e234659c..a99533e8 100755 --- a/bin/detect.py +++ b/bin/detect.py @@ -125,3 +125,6 @@ if detector.board.any_walnutpi: print("Walnut Pi detected.") + +if detector.board.any_horizon_board: + print("Horizon detected.")