From 16e3e94bf4047f2c319d3540532204fcdb518bb6 Mon Sep 17 00:00:00 2001 From: Technobly Date: Tue, 29 Apr 2025 11:07:30 -0500 Subject: [PATCH] Support for Particle Tachyon --- adafruit_platformdetect/board.py | 8 ++++++++ adafruit_platformdetect/chip.py | 3 +++ adafruit_platformdetect/constants/boards.py | 6 ++++++ adafruit_platformdetect/constants/chips.py | 1 + 4 files changed, 18 insertions(+) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index b302d17..e14758c 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.QCM6490: + board_id = boards.PARTICLE_TACHYON self._board_id = board_id return board_id @@ -1198,6 +1200,11 @@ def any_horizon_board(self): """Check whether the current board is any Horizon device.""" return self.id in boards._HORIZON_IDS + @property + def any_particle_board(self): + """Check whether the current board is any Particle device.""" + return self.id in boards._PARTICLE_IDS + @property def os_environ_board(self) -> bool: """Check whether the current board is an OS environment variable special case.""" @@ -1272,6 +1279,7 @@ def lazily_generate_conditions(): yield self.any_vivid_unit yield self.any_starfive_id yield self.any_horizon_board + yield self.any_particle_board return any(condition for condition in lazily_generate_conditions()) diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index cabc733..f07c091 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("particle,tachyon"): + return chips.QCM6490 + linux_id = None hardware = self.detector.get_cpuinfo_field("Hardware") diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 6e1742e..296589e 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -270,6 +270,9 @@ # Horizon RDK_X3 = "RDK_X3" +# Particle +PARTICLE_TACHYON = "PARTICLE_TACHYON" + # StarFive boards _STARFIVE_BOARD_IDS = (VISIONFIVE2,) # Asus Tinkerboard @@ -688,5 +691,8 @@ _AMERIDROID_IDS = (INDIEDROID_NOVA,) +# Particle +_PARTICLE_IDS = (PARTICLE_TACHYON,) + # Agnostic board OS_AGNOSTIC_BOARD = "OS_AGNOSTIC_BOARD" diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index a08bf59..69bc7bc 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -87,6 +87,7 @@ RZV2N = "RZV2N" RZV2H = "RZV2H" SUNRISE_X3 = "SUNRISE_X3" +QCM6490 = "QCM6490" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"}