Skip to content

Commit fb283c4

Browse files
authored
Merge pull request #121 from scottamain/master
Add detection for Coral Dev Board Mini
2 parents 0461785 + 1e83152 commit fb283c4

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

adafruit_platformdetect/board.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def id(self):
137137
board_id = self._udoo_id()
138138
elif chip_id == chips.STM32MP157:
139139
board_id = self._stm32mp1_id()
140+
elif chip_id == chips.MT8167:
141+
board_id = boards.CORAL_EDGE_TPU_DEV_MINI
140142

141143
self._board_id = board_id
142144
return board_id
@@ -401,7 +403,7 @@ def any_orange_pi(self):
401403
@property
402404
def any_coral_board(self):
403405
"""Check whether the current board is any defined Coral."""
404-
return self.CORAL_EDGE_TPU_DEV
406+
return self.id in boards._CORAL_IDS
405407

406408
@property
407409
def any_pynq_board(self):

adafruit_platformdetect/chip.py

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ def _linux_id(self):
153153
if self.detector.check_dt_compatible_value("sun50i-a64"):
154154
return chips.A64
155155

156+
if self.detector.check_dt_compatible_value("mediatek,mt8167"):
157+
return chips.MT8167
158+
156159
linux_id = None
157160
hardware = self.detector.get_cpuinfo_field("Hardware")
158161

adafruit_platformdetect/constants/boards.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
# Google Coral dev board
5656
CORAL_EDGE_TPU_DEV = "CORAL_EDGE_TPU_DEV"
57+
CORAL_EDGE_TPU_DEV_MINI = "CORAL_EDGE_TPU_DEV_MINI"
5758

5859
# Xilinx PYNQ FPGA dev boards
5960
PYNQ_Z1 = "PYNQ_Z1"
@@ -137,7 +138,11 @@
137138
# BananaPI
138139
_BANANA_PI_IDS = (BANANA_PI_M2_ZERO,)
139140

140-
_CORAL_IDS = (CORAL_EDGE_TPU_DEV,)
141+
# Coral boards
142+
_CORAL_IDS = (
143+
CORAL_EDGE_TPU_DEV,
144+
CORAL_EDGE_TPU_DEV_MINI,
145+
)
141146

142147
_PYNQ_IDS = (PYNQ_Z1, PYNQ_Z2)
143148

adafruit_platformdetect/constants/chips.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
3636
STM32F405 = "STM32F405"
3737
STM32MP157 = "STM32MP157"
38+
MT8167 = "MT8167"
3839

3940
BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"}

bin/detect.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
print("Is this a BeagleBone Black?", detector.board.BEAGLEBONE_BLACK)
1717
print("Is this a BeagleBone Green?", detector.board.BEAGLEBONE_GREEN)
1818
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
19-
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
19+
print("Is this a Coral Dev Board?", detector.board.CORAL_EDGE_TPU_DEV)
20+
print("Is this a Coral Dev Board Mini?", detector.board.CORAL_EDGE_TPU_DEV_MINI)
2021
print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED)
2122
print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2)
2223
print("Is this a Rock Pi board?", detector.board.any_rock_pi_board)
@@ -63,3 +64,6 @@
6364

6465
if detector.board.any_asus_tinker_board:
6566
print("ASUS Tinker Board device detected.")
67+
68+
if detector.board.any_coral_board:
69+
print("Coral device detected.")

0 commit comments

Comments
 (0)