Skip to content

Added board detection for UDOO Bolt using check_board_asset_value() #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 23, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Board:

def __init__(self, detector):
self.detector = detector
self.board_asset_tag = self.detector.check_board_asset_tag_value().strip()

# pylint: disable=invalid-name, protected-access
@property
Expand Down Expand Up @@ -117,7 +118,7 @@ def id(self):
board_id = self._clockwork_pi_id()
elif chip_id == chips.RK3308:
board_id = self._rock_pi_id()
elif chip_id == chips.RYZEN_V1605B:
elif self.board_asset_tag == "SC40-2000-0000-C0|C":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the actual tag into the constants/board.py file? You could make an IDs tuple like we did for other boards. That way if UDOO adds additional IDs, it's easy to add new ones in and it looks cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?`
'_UDOO_BOLT_ASSET = "SC40-2000-0000-C0|C"

_UDOO_IDS = (
UDOO_BOLT,
_UDOO_BOLT_ASSET,
)'

Copy link
Collaborator

@makermelissa makermelissa May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite. More like:

_UDOO_BOARD_IDS = {
    UDOO_BOLT: (
        "SC40-2000-0000-C0|C",
    )
}

board_id = boards.UDOO_BOLT

return board_id
Expand Down
3 changes: 2 additions & 1 deletion bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
detector = adafruit_platformdetect.Detector()

print("Chip id: ", detector.chip.id)

print("Board id: ", detector.board.id)
print()

print("Is this a DragonBoard 410c?", detector.board.DRAGONBOARD_410C)
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
Expand All @@ -23,6 +23,7 @@
print("Is this a Clockwork Pi board?", detector.board.any_clockwork_pi_board)
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC)
print("Is this a UDOO Bolt?", detector.board.UDOO_BOLT)
print(
"Is this an OS environment variable special case?",
detector.board.FTDI_FT232H
Expand Down