-
Notifications
You must be signed in to change notification settings - Fork 239
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
Added support for Radxa Rock 5C #357
Conversation
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.
To speed it up, you could just check for "ROCK 5C" before checking for "ROCK 5".
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.
Close. Can you just put the check for 5C before the 5? The reason is because the 5C would always match the 5 string as well.
Because each board is judged using an if statement, if the if statement for ROCK 5C is executed first, the result will be overwritten by the if statement for ROCK 5 that follows.
|
There isn't anything that is being "overwritten". An if/else if statement like this stops looking once it finds a match. So once it sees that "ROCK 5" matches, it uses that and stops looking. |
I tested this commit with Rock 5B and Rock 5C with the following code.
The results for Rock 5B are as follows:
The results for Rock 5C are as follows:
|
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 looks great. Thank you.
I added support for Radxa Rock 5C.
I also added support for Radxa Rock 5C to Adafruit_Blinka.