Skip to content

Commit af62ea4

Browse files
authored
Merge pull request #305 from Xenokrates/bananapro
Added support for board 'Lemaker Banana Pro'
2 parents 139c43d + c7f8528 commit af62ea4

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

adafruit_platformdetect/board.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def _tisk_id(self) -> Optional[str]:
342342

343343
# pylint: disable=too-many-return-statements
344344
def _armbian_id(self) -> Optional[str]:
345-
"""Check whether the current board is an OrangePi board."""
345+
"""Get the current board via the ARMBIAN release field."""
346346
board_value = self.detector.get_armbian_release_field("BOARD")
347347
board = None
348348

@@ -384,6 +384,8 @@ def _armbian_id(self) -> Optional[str]:
384384
board = boards.BANANA_PI_M2_BERRY
385385
elif board_value == "bananapim5":
386386
board = boards.BANANA_PI_M5
387+
elif board_value == "bananapipro":
388+
board = boards.LEMAKER_BANANA_PRO
387389
elif board_value == "orangepizeroplus2-h5":
388390
board = boards.ORANGE_PI_ZERO_PLUS_2H5
389391
elif board_value == "orangepizeroplus":
@@ -860,6 +862,11 @@ def any_bananapi(self) -> bool:
860862
"""Check whether the current board is any BananaPi-family system."""
861863
return self.id in boards._BANANA_PI_IDS
862864

865+
@property
866+
def any_lemaker(self) -> bool:
867+
"""Check whether the current board is any LeMaker board."""
868+
return self.id in boards._LEMAKER_IDS
869+
863870
@property
864871
def any_maaxboard(self) -> bool:
865872
"""Check whether the current board is any BananaPi-family system."""
@@ -937,6 +944,7 @@ def lazily_generate_conditions():
937944
yield self.any_stm32mp1
938945
yield self.any_lubancat
939946
yield self.any_bananapi
947+
yield self.any_lemaker
940948
yield self.any_maaxboard
941949
yield self.any_tisk_board
942950
yield self.any_siemens_simatic_iot2000

adafruit_platformdetect/constants/boards.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
BANANA_PI_M2_BERRY = "BANANA_PI_M2_BERRY"
7171
BANANA_PI_M5 = "BANANA_PI_M5"
7272

73+
# LeMaker boards
74+
LEMAKER_BANANA_PRO = "LEMAKER_BANANA_PRO"
75+
7376
# NVIDIA Jetson boards
7477
JETSON_TX1 = "JETSON_TX1"
7578
JETSON_TX2 = "JETSON_TX2"
@@ -243,7 +246,11 @@
243246
)
244247

245248
# NanoPi
246-
_NANOPI_IDS = (NANOPI_NEO_AIR, NANOPI_DUO2, NANOPI_NEO)
249+
_NANOPI_IDS = (
250+
NANOPI_NEO_AIR,
251+
NANOPI_DUO2,
252+
NANOPI_NEO,
253+
)
247254

248255
# BananaPI
249256
_BANANA_PI_IDS = (
@@ -253,6 +260,9 @@
253260
BANANA_PI_M5,
254261
)
255262

263+
# LeMaker
264+
_LEMAKER_IDS = (LEMAKER_BANANA_PRO,)
265+
256266
# LubanCat
257267
_LUBANCAT_IDS = (
258268
LUBANCAT_IMX6ULL,

bin/detect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
if detector.board.any_orange_pi:
8686
print("Orange Pi detected.")
8787

88+
if detector.board.any_lemaker:
89+
print("LeMaker board detected.")
90+
8891
if detector.board.any_odroid_40_pin:
8992
print("Odroid detected.")
9093

0 commit comments

Comments
 (0)