-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
A6, A7, PIN_A6, PIN_A7 exist when there are not 8 analog pins #141
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
Comments
Sounds good to me. Care to submit a PR? |
PR meaning pull request? |
off of what branch? master or ide-1.5.x |
Please branch off of master. |
How will this change impact people who bootload nano/pro mini boards as Unos? This is a fairly common practice, since the Uno bootloader is strictly better, so some thought should be given to it's impact on these users... It seems like it would needlessly break sketches and would force people onto third party hardware libraries if they want to use 8 analog inputs with the good bootloader - and the benefit isn't clear to me. |
@SpenceKonde, While all the AVR based boards are all using avrdude and "arduino" protocol for the upload, So yeah, there are multiple issue here and the "fix" for incorrectly creating A6 and A7 symbols on boards where they don't exist is not as simple as correcting the symbols to only show up for the eightanaloginputs boards particularly when considering backward compatibility of these work around use cases for using optiboot. There does not seem to be an easy fix for this. The issue with simply updating all the board types to now use optiboot is that the baud rate is different than the non optiboot bootloader and so older or existing board would not be able to be uploaded until they had a new bootloader installed - this is not a valid option. One way to handle this would be to add a menu field for those boards to select the bootloader for those boards. Then and only then , could the the A6 and A7 symbols be eliminated for the non eightanaloginputs boards. So the real issue seems to be how to solve using optiboot for the older the AVR boards as that is a much bigger and definite real-world issue. arduino.cc developers? |
The standard variant always creates the defines PIN_A6 and PIN_A7 and the constants A6 and A7 even when there are not 8 analog inputs.
The variant eightanaloginputs exists to declare that the h/w as 8 analog inputs so why not use that in the standard variant to disable the extra two inputs when they don't exist.
It only requires a slight tweaking of the files.
i.e.
In eightanalog inputs pins_arduino.h
And in the standard pins_arduino.h
That way they only exist when they should and sketch could actually use something like
# ifdef PIN_A6
to determine if there is an analog pin A6 or not.
Same for A7
The text was updated successfully, but these errors were encountered: