-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add OrangePI R1 detection #23
Conversation
adafruit_platformdetect/board.py
Outdated
@@ -336,6 +337,14 @@ def _armbian_id(self): | |||
return ORANGE_PI_PC | |||
return None | |||
|
|||
def _armbian_id(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code should be merged with the above, not replace!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like this?
def _armbian_id(self):
"""Check whether the current board is an OrangePi PC."""
board_value = self.detector.get_armbian_release_field('BOARD')
if board_value == "orangepipc":
return ORANGE_PI_PC
if board_value == "orangepi-r1":
return ORANGE_PI_R1
return None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the Travis errors. It looks like there are some tabs instead of spaces for a few lines and they weren't lining up properly. Thanks.
I noticed a couple more things that need to be added. We'll need an Orange Pi IDs list like
Also we'll need the
|
changed and updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's a couple more changes. Please see comments.
@@ -25,8 +25,6 @@ | |||
GENERIC_LINUX_PC = "GENERIC_LINUX_PC" | |||
PYBOARD = "PYBOARD" | |||
NODEMCU = "NODEMCU" | |||
ORANGE_PI_PC = "ORANGE_PI_PC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to leave both of these IDs here too. This is where they are defined.
adafruit_platformdetect/board.py
Outdated
@@ -384,7 +388,7 @@ def any_beaglebone(self): | |||
@property | |||
def any_orange_pi(self): | |||
"""Check whether the current board is any defined Orange Pi.""" | |||
return self.ORANGE_PI_PC | |||
return self.ORANGE_PI_IDS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return a True/False value instead of a list. Also, the list starts with an underscore character.
At a glance, this looks good. I'll test it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested good.
@ladyada, looks like you'll need to merge this in. I don't have the permissions currently. |
ok cool to verify you got an R1? |
Yes I did. |
rad, ill give you perms too |
Thanks :) |
No description provided.