-
Notifications
You must be signed in to change notification settings - Fork 941
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
atsamd51 atsame5x: change to allow specifying the ADC Bus number #1835
base: dev
Are you sure you want to change the base?
Conversation
@@ -39,4 +39,5 @@ func (p Pin) Low() { | |||
|
|||
type ADC struct { | |||
Pin Pin | |||
Bus uint8 |
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.
Due to this change, src/examples/adc needs to be modified
This is not directly related to this PR, but I noticed that the following sources can be unified.
|
Fixed with #1845 |
I think there is probably a different way you can solve this @sago35 that does not require breaking the current API. For example, your function What do you think? |
The original version of getADCBus() was implemented in such a way that if there were two candidates, it would return one of them. If there is only one bus that the Pin can use, it will return that bus. Hmm, I can't think of a good way to do this. |
The dev branch is in progress, so I rebased it. |
For PB08 and PB09, and PA08 and PA09, it was not possible to select which ADC instance to use until now.
Since the two ADC instances can be sampled at the same time, we want to be able to select which ADC instance to use.
I tried to change the source code, but there may be a better way.
Also, as I was making changes in src/examples/adc, I ended up with incompatible changes in environments other than atsamx5x.
Would it be better to make sure that all environments except atsamx5x are not incompatible?