Browse Source

Update board.py

pull/166/head
twa127 3 years ago
committed by GitHub
parent
commit
6cb13015ad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 3 deletions
  1. +24
    -3
      adafruit_platformdetect/board.py

+ 24
- 3
adafruit_platformdetect/board.py View File

@ -80,7 +80,7 @@ class Board:
elif chip_id == chips.GENERIC_X86:
board_id = boards.GENERIC_LINUX_PC
elif chip_id == chips.SUN8I:
board_id = self._armbian_id()
board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.SAMA5:
board_id = self._sama5_id()
elif chip_id == chips.IMX8MX:
@ -136,9 +136,9 @@ class Board:
elif chip_id == chips.H6:
board_id = self._pine64_id()
elif chip_id == chips.H5:
board_id = self._armbian_id()
board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.H616:
board_id = self._armbian_id()
board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.A33:
board_id = self._clockwork_pi_id()
elif chip_id == chips.RK3308:
@ -438,6 +438,27 @@ class Board:
board = boards._ASUS_TINKER_BOARD_IDS
return board
def _allwinner_variants_id(self):
"""Try to detect the id of allwinner based board. (orangepi, nanopi)"""
board_value = self.detector.get_device_model()
board = None
if not board_value:
return board
board_value = board_value.lower()
chip_id = self.detector.chip.id
if "nanopi" in board_value:
if "neo" in board_value and "SUN8I" in chip_id:
board = boards.NANOPI_NEO_AIR
# TODO: Add other specifc board contexts here
elif "orange pi" in board_value:
if "zero" in board_value:
if "H5" in chip_id:
board = boards.ORANGE_PI_ZERO_PLUS_2H5
elif "H616" in chip_id:
board = boards.ORANGE_PI_ZERO_2
# TODO: Add other specifc board contexts here
return board
@property
def any_nanopi(self):
"""Check whether the current board is any defined Nano Pi."""


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