Skip to content

Commit

Permalink
Merge pull request #370 from hajimef/develop
Browse files Browse the repository at this point in the history
Added support for D-Robotics RDK-X3
  • Loading branch information
makermelissa authored Jan 3, 2025
2 parents 0c6bd4c + 9ba3d32 commit 49b6779
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def id(self) -> Optional[str]:
board_id = self._rv1103_id()
elif chip_id == chips.RV1106:
board_id = self._rv1106_id()
elif chip_id == chips.SUNRISE_X3:
board_id = boards.RDK_X3
self._board_id = board_id
return board_id

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

@property
def any_horizon_board(self):
"""Check whether the current board is any Horizon device."""
return self.id in boards._HORIZON_IDS

@property
def os_environ_board(self) -> bool:
"""Check whether the current board is an OS environment variable special case."""
Expand Down Expand Up @@ -1180,6 +1187,7 @@ def lazily_generate_conditions():
yield self.any_luckfox_pico_board
yield self.any_vivid_unit
yield self.any_starfive_id
yield self.any_horizon_board

return any(condition for condition in lazily_generate_conditions())

Expand Down
3 changes: 3 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def _linux_id(self) -> Optional[str]:
if self.detector.check_dt_compatible_value("light-lpi4a"):
return chips.TH1520

if self.detector.check_dt_compatible_value("hobot,x3"):
return chips.SUNRISE_X3

linux_id = None
hardware = self.detector.get_cpuinfo_field("Hardware")

Expand Down
6 changes: 6 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@
# Ameridroid boards
INDIEDROID_NOVA = "INDIEDROID_NOVA"

# Horizon
RDK_X3 = "RDK_X3"

# StarFive boards
_STARFIVE_BOARD_IDS = (VISIONFIVE2,)
# Asus Tinkerboard
Expand Down Expand Up @@ -632,6 +635,9 @@
LUCKFOX_PICO_PLUS,
)

# Horizon
_HORIZON_IDS = (RDK_X3,)

_AMERIDROID_IDS = (INDIEDROID_NOVA,)

# Agnostic board
Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
ATOM_J4105 = "ATOM_J4105"
TH1520 = "TH1520"
K1 = "K1"
SUNRISE_X3 = "SUNRISE_X3"

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

Expand Down

0 comments on commit 49b6779

Please sign in to comment.