Skip to content

Commit ccc452f

Browse files
authored
Merge pull request #337 from casainho/main
Added board MilkV Duo
2 parents ee81a52 + c08c2ec commit ccc452f

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ def id(self) -> Optional[str]:
203203
board_id = self._armbian_id()
204204
elif chip_id == chips.S905X:
205205
board_id = boards.AML_S905X_CC
206+
elif chip_id == chips.CV1800B:
207+
board_id = boards.MILKV_DUO
206208
self._board_id = board_id
207209
return board_id
208210

@@ -418,6 +420,8 @@ def _armbian_id(self) -> Optional[str]:
418420
board = boards.PCDUINO3
419421
elif board_value == "rock-3a":
420422
board = boards.ROCK_PI_3A
423+
elif board_value == "milkv_duo":
424+
board = boards.MILKV_DUO
421425
return board
422426

423427
# pylint: enable=too-many-return-statements
@@ -864,6 +868,11 @@ def any_pine64_board(self) -> bool:
864868
"""Check whether the current board is any Pine64 device."""
865869
return self.id in boards._PINE64_DEV_IDS
866870

871+
@property
872+
def any_milkv_board(self) -> bool:
873+
"""Check whether the current board is any MilkV device."""
874+
return self.id in boards._MILKV_IDS_
875+
867876
@property
868877
def any_rock_pi_board(self) -> bool:
869878
"""Check whether the current board is any Rock Pi device."""
@@ -1002,6 +1011,7 @@ def lazily_generate_conditions():
10021011
yield self.any_nxp_navq_board
10031012
yield self.any_walnutpi
10041013
yield self.any_olimex_lime2_board
1014+
yield self.any_milkv_board
10051015

10061016
return any(condition for condition in lazily_generate_conditions())
10071017

adafruit_platformdetect/chip.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ def _linux_id(self) -> Optional[str]:
355355
linux_id = chips.H5
356356
if compatible and "odroid-xu4" in compatible:
357357
linux_id = chips.EXYNOS5422
358+
if compatible and "cvitek,cv180x" in compatible:
359+
linux_id = chips.CV1800B
358360
cpu_model = self.detector.get_cpuinfo_field("cpu model")
359361

360362
if cpu_model is not None:

adafruit_platformdetect/constants/boards.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@
214214
MAAXBOARD = "MAAXBOARD"
215215
MAAXBOARD_MINI = "MAAXBOARD_MINI"
216216

217+
# Shenzhen MilkV Technology boards ids
218+
MILKV_DUO = "MILKV_DUO"
219+
217220
# Khadas VIM3
218221
KHADAS_VIM3 = "KHADAS_VIM3"
219222

@@ -559,3 +562,5 @@
559562
NXP_IMX8MPLUS_SOM = "NXP_IMX8MPLUS_SOM"
560563

561564
_NXP_SOM_IDS = (NXP_IMX8MPLUS_SOM,)
565+
566+
_MILKV_IDS_ = (MILKV_DUO,)

adafruit_platformdetect/constants/chips.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@
7575
ATOM_J4105 = "ATOM_J4105"
7676

7777
BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"}
78+
79+
CV1800B = "CV1800B"

bin/detect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
print("Is this a UDOO board?", detector.board.any_udoo_board)
6969
print("Is this an ASUS Tinker board?", detector.board.any_asus_tinker_board)
7070
print("Is this an STM32MP1 board?", detector.board.any_stm32mp1)
71+
print("Is this a MilkV board?", detector.board.any_milkv_board)
7172
print("Is this a generic Linux PC?", detector.board.generic_linux)
7273
print(
7374
"Is this an OS environment variable special case?", detector.board.os_environ_board

0 commit comments

Comments
 (0)