Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for D-Robotics RDK-X3 #370

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -251,6 +251,9 @@
# Ameridroid boards
INDIEDROID_NOVA = "INDIEDROID_NOVA"

# Horizon
RDK_X3 = "RDK_X3"

# StarFive boards
_STARFIVE_BOARD_IDS = (VISIONFIVE2,)
# Asus Tinkerboard
Expand Down Expand Up @@ -629,6 +632,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
Loading