Skip to content

Commit 95fb4af

Browse files
authored
Merge pull request #310 from sc-bin/main
add support for walnutpi-1b
2 parents 86f614b + f99e1db commit 95fb4af

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ def _allwinner_variants_id(self) -> Optional[str]:
686686
board = boards.ORANGE_PI_ZERO_PLUS_2H5
687687
elif "H616" in chip_id:
688688
board = boards.ORANGE_PI_ZERO_2
689+
elif "walnutpi-1b" in board_value:
690+
board = boards.WALNUT_PI_1B
689691
# TODO: Add other specifc board contexts here
690692
return board
691693

@@ -749,6 +751,11 @@ def any_siemens_simatic_iot2000(self) -> bool:
749751
"""Check whether the current board is a SIEMENS SIMATIC IOT2000 Gateway."""
750752
return self.id in boards._SIEMENS_SIMATIC_IOT2000_IDS
751753

754+
@property
755+
def any_walnutpi(self) -> bool:
756+
"""Check whether the current board is any defined Walnut Pi."""
757+
return self.id in boards._WALNUT_PI_IDS
758+
752759
@property
753760
def any_nanopi(self) -> bool:
754761
"""Check whether the current board is any defined Nano Pi."""
@@ -970,6 +977,7 @@ def lazily_generate_conditions():
970977
yield self.any_libre_computer_board
971978
yield self.generic_linux
972979
yield self.any_nxp_navq_board
980+
yield self.any_walnutpi
973981

974982
return any(condition for condition in lazily_generate_conditions())
975983

adafruit_platformdetect/constants/boards.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
ASUS_TINKER_BOARD_2 = "ASUS_TINKER_BOARD_2"
3939
ASUS_TINKER_EDGE_R = "ASUS_TINKER_EDGE_R"
4040

41+
# Walnut Pi boards
42+
WALNUT_PI_1B = "WALNUT_PI_1B"
43+
4144
# Clockwork Pi boards
4245
CLOCKWORK_CPI3 = "CLOCKWORK_CPI3"
4346

@@ -219,6 +222,9 @@
219222
ASUS_TINKER_EDGE_R,
220223
)
221224

225+
# WalnutPi
226+
_WALNUT_PI_IDS = (WALNUT_PI_1B,)
227+
222228
# STM32MP1
223229
_STM32MP1_IDS = (
224230
STM32MP157C_DK2,

bin/detect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@
117117

118118
if detector.board.any_nxp_navq_board:
119119
print("NXP NavQ board detected.")
120+
121+
if detector.board.any_walnutpi:
122+
print("Walnut Pi detected.")

0 commit comments

Comments
 (0)