You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in analogRead() does not not handle integer arguments of 8..15, which are valid analog pins on Grand Central. Worse, it will do "bad things", like setting PINMUX to "analog" on pins that don't even have analog support.
There's enough special code in analogRead() already that it really ought to handle this as well. It should at least not do bad things (and doing the right thing is just as easy...)
I have a patch and will submit a pull-request.
The text was updated successfully, but these errors were encountered:
WestfW
added a commit
to WestfW-patches/AdadfruitCore-samd
that referenced
this issue
Jul 18, 2020
This "bug" exists on other platforms with more than 8 analog inputs as well (CircuitPlaygroundExpress, for example), since the analogRead() code only adds the offset for n<=5, n=6, and n=7.
On all of them, A0..An are contiguous, so it doesn't NEED the (p-8)+A8 math. But it won't hurt, either. (and actually, it gets eliminated by the optimizer.)
The code in analogRead() does not not handle integer arguments of 8..15, which are valid analog pins on Grand Central. Worse, it will do "bad things", like setting PINMUX to "analog" on pins that don't even have analog support.
https://forums.adafruit.com/viewtopic.php?f=63&t=157146
https://forums.adafruit.com/viewtopic.php?f=63&t=167446
There's enough special code in analogRead() already that it really ought to handle this as well. It should at least not do bad things (and doing the right thing is just as easy...)
I have a patch and will submit a pull-request.
The text was updated successfully, but these errors were encountered: