Skip to content

Commit 49b6779

Browse files
authored
Merge pull request #370 from hajimef/develop
Added support for D-Robotics RDK-X3
2 parents 0c6bd4c + 9ba3d32 commit 49b6779

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

adafruit_platformdetect/board.py

+8
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ def id(self) -> Optional[str]:
228228
board_id = self._rv1103_id()
229229
elif chip_id == chips.RV1106:
230230
board_id = self._rv1106_id()
231+
elif chip_id == chips.SUNRISE_X3:
232+
board_id = boards.RDK_X3
231233
self._board_id = board_id
232234
return board_id
233235

@@ -1109,6 +1111,11 @@ def any_vivid_unit(self):
11091111
"""Check whether the current board is any Vivid Unit device."""
11101112
return self.id in boards._VIVID_UNIT_IDS
11111113

1114+
@property
1115+
def any_horizon_board(self):
1116+
"""Check whether the current board is any Horizon device."""
1117+
return self.id in boards._HORIZON_IDS
1118+
11121119
@property
11131120
def os_environ_board(self) -> bool:
11141121
"""Check whether the current board is an OS environment variable special case."""
@@ -1180,6 +1187,7 @@ def lazily_generate_conditions():
11801187
yield self.any_luckfox_pico_board
11811188
yield self.any_vivid_unit
11821189
yield self.any_starfive_id
1190+
yield self.any_horizon_board
11831191

11841192
return any(condition for condition in lazily_generate_conditions())
11851193

adafruit_platformdetect/chip.py

+3
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ def _linux_id(self) -> Optional[str]:
321321
if self.detector.check_dt_compatible_value("light-lpi4a"):
322322
return chips.TH1520
323323

324+
if self.detector.check_dt_compatible_value("hobot,x3"):
325+
return chips.SUNRISE_X3
326+
324327
linux_id = None
325328
hardware = self.detector.get_cpuinfo_field("Hardware")
326329

adafruit_platformdetect/constants/boards.py

+6
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@
252252
# Ameridroid boards
253253
INDIEDROID_NOVA = "INDIEDROID_NOVA"
254254

255+
# Horizon
256+
RDK_X3 = "RDK_X3"
257+
255258
# StarFive boards
256259
_STARFIVE_BOARD_IDS = (VISIONFIVE2,)
257260
# Asus Tinkerboard
@@ -632,6 +635,9 @@
632635
LUCKFOX_PICO_PLUS,
633636
)
634637

638+
# Horizon
639+
_HORIZON_IDS = (RDK_X3,)
640+
635641
_AMERIDROID_IDS = (INDIEDROID_NOVA,)
636642

637643
# Agnostic board

adafruit_platformdetect/constants/chips.py

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
ATOM_J4105 = "ATOM_J4105"
8282
TH1520 = "TH1520"
8383
K1 = "K1"
84+
SUNRISE_X3 = "SUNRISE_X3"
8485

8586
BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"}
8687

0 commit comments

Comments
 (0)