Browse Source

Merge pull request #24 from makermelissa/master

Improved Odroid C2 Detection
pull/25/head 1.0.4
Limor "Ladyada" Fried 5 years ago
committed by GitHub
parent
commit
71805aedb6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions
  1. +6
    -1
      adafruit_platformdetect/board.py
  2. +2
    -0
      adafruit_platformdetect/chip.py
  3. +7
    -2
      bin/detect.py

+ 6
- 1
adafruit_platformdetect/board.py View File

@ -402,6 +402,11 @@ class Board:
"""Check whether the current board is any defined Giant Board."""
return self.GIANT_BOARD
@property
def any_odroid_40_pin(self):
"""Check whether the current board is any defined 40-pin Odroid."""
return self.id in _ODROID_40_PIN_IDS
@property
def any_jetson_board(self):
"""Check whether the current board is any defined Jetson Board."""
@ -412,7 +417,7 @@ class Board:
"""Check whether the current board is any embedded Linux device."""
return self.any_raspberry_pi or self.any_beaglebone or \
self.any_orange_pi or self.any_giant_board or self.any_jetson_board or \
self.any_coral_board
self.any_coral_board or self.any_odroid_40_pin
def __getattr__(self, attr):
"""


+ 2
- 0
adafruit_platformdetect/chip.py View File

@ -92,6 +92,8 @@ class Chip:
linux_id = T194
if compatible and 'imx8m' in compatible:
linux_id = IMX8MX
if compatible and 'odroid-c2' in compatible:
linux_id = S905
elif hardware in ("BCM2708", "BCM2709", "BCM2835"):
linux_id = BCM2XXX


+ 7
- 2
bin/detect.py View File

@ -11,7 +11,6 @@ print("Board id: ", detector.board.id)
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
print("Is this a BBB?", detector.board.BEAGLEBONE_BLACK)
print("Is this an Orange Pi PC?", detector.board.ORANGE_PI_PC)
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
@ -21,4 +20,10 @@ if detector.board.any_raspberry_pi:
print("Raspberry Pi detected.")
if detector.board.any_jetson_board:
print("Jetson platform detected.")
print("Jetson platform detected.")
if detector.board.any_orange_pi:
print("Orange Pi detected.")
if detector.board.any_odroid_40_pin:
print("Odroid detected.")

|||||||
x
 
000:0
Loading…
Cancel
Save