Skip to content

Commit cf5f419

Browse files
authored
Merge pull request #328 from KingPharoo/main
Added support for Olimex A20-LIME2-EMMC Board
2 parents 2c5a187 + 858e1ce commit cf5f419

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

adafruit_platformdetect/board.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def id(self) -> Optional[str]:
140140
elif chip_id == chips.A10:
141141
board_id = self._armbian_id()
142142
elif chip_id == chips.A20:
143-
board_id = self._armbian_id()
143+
board_id = self._armbian_id() or self._allwinner_variants_id()
144144
elif chip_id == chips.A64:
145145
board_id = self._pine64_id()
146146
elif chip_id == chips.H6:
@@ -704,6 +704,9 @@ def _allwinner_variants_id(self) -> Optional[str]:
704704
elif "walnutpi-1b" in board_value:
705705
board = boards.WALNUT_PI_1B
706706
# TODO: Add other specifc board contexts here
707+
708+
elif "lime2" in board_value:
709+
board = boards.OLIMEX_LIME2
707710
return board
708711

709712
# pylint: disable=too-many-return-statements
@@ -931,6 +934,11 @@ def any_nxp_navq_board(self) -> bool:
931934
"""Check whether the current board is any NXP NavQ board"""
932935
return self.id in boards._NXP_SOM_IDS
933936

937+
@property
938+
def any_olimex_lime2_board(self):
939+
"""Check whether the current board is any Pine64 device."""
940+
return self.id in boards.OLIMEX_LIME2
941+
934942
@property
935943
def os_environ_board(self) -> bool:
936944
"""Check whether the current board is an OS environment variable special case."""
@@ -993,6 +1001,7 @@ def lazily_generate_conditions():
9931001
yield self.generic_linux
9941002
yield self.any_nxp_navq_board
9951003
yield self.any_walnutpi
1004+
yield self.any_olimex_lime2_board
9961005

9971006
return any(condition for condition in lazily_generate_conditions())
9981007

adafruit_platformdetect/constants/boards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
BEAGLELOGIC_STANDALONE = "BEAGLELOGIC_STANDALONE"
2525
OSD3358_DEV_BOARD = "OSD3358_DEV_BOARD"
2626
OSD3358_SM_RED = "OSD3358_SM_RED"
27-
27+
OLIMEX_LIME2 = "OLIMEX_LIME2"
2828
FEATHER_HUZZAH = "FEATHER_HUZZAH"
2929
FEATHER_M0_EXPRESS = "FEATHER_M0_EXPRESS"
3030
GENERIC_LINUX_PC = "GENERIC_LINUX_PC"

0 commit comments

Comments
 (0)