Skip to content

Commit 71805ae

Browse files
authored
Merge pull request #24 from makermelissa/master
Improved Odroid C2 Detection
2 parents 72bd91f + 0d5dd9e commit 71805ae

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

adafruit_platformdetect/board.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ def any_giant_board(self):
402402
"""Check whether the current board is any defined Giant Board."""
403403
return self.GIANT_BOARD
404404

405+
@property
406+
def any_odroid_40_pin(self):
407+
"""Check whether the current board is any defined 40-pin Odroid."""
408+
return self.id in _ODROID_40_PIN_IDS
409+
405410
@property
406411
def any_jetson_board(self):
407412
"""Check whether the current board is any defined Jetson Board."""
@@ -412,7 +417,7 @@ def any_embedded_linux(self):
412417
"""Check whether the current board is any embedded Linux device."""
413418
return self.any_raspberry_pi or self.any_beaglebone or \
414419
self.any_orange_pi or self.any_giant_board or self.any_jetson_board or \
415-
self.any_coral_board
420+
self.any_coral_board or self.any_odroid_40_pin
416421

417422
def __getattr__(self, attr):
418423
"""

adafruit_platformdetect/chip.py

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def _linux_id(self): # pylint: disable=too-many-branches
9292
linux_id = T194
9393
if compatible and 'imx8m' in compatible:
9494
linux_id = IMX8MX
95+
if compatible and 'odroid-c2' in compatible:
96+
linux_id = S905
9597

9698
elif hardware in ("BCM2708", "BCM2709", "BCM2835"):
9799
linux_id = BCM2XXX

bin/detect.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
1212
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
1313
print("Is this a BBB?", detector.board.BEAGLEBONE_BLACK)
14-
print("Is this an Orange Pi PC?", detector.board.ORANGE_PI_PC)
1514
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
1615
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
1716
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
@@ -21,4 +20,10 @@
2120
print("Raspberry Pi detected.")
2221

2322
if detector.board.any_jetson_board:
24-
print("Jetson platform detected.")
23+
print("Jetson platform detected.")
24+
25+
if detector.board.any_orange_pi:
26+
print("Orange Pi detected.")
27+
28+
if detector.board.any_odroid_40_pin:
29+
print("Odroid detected.")

0 commit comments

Comments
 (0)