Skip to content
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

Incorrect digitalPinToPCMSK macro in standard variant #34

Closed
per1234 opened this issue Aug 23, 2016 · 1 comment
Closed

Incorrect digitalPinToPCMSK macro in standard variant #34

per1234 opened this issue Aug 23, 2016 · 1 comment

Comments

@per1234
Copy link
Contributor

per1234 commented Aug 23, 2016

https://github.com/MCUdude/MightyCore/blob/master/avr/variants/standard/pins_arduino.h#L89-L90 is:

#define digitalPinToPCICRbit(p) (((p) <= 7) ? 1 : (((p) <= 15) ? 3 : (((p) <= 23) ? 2 : 0)))
#define digitalPinToPCMSK(p)    (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))

but https://github.com/JChristensen/mighty-1284p/blob/v1.6.3/avr/variants/standard/pins_arduino.h#L67-L68 is:

#define digitalPinToPCICRbit(p) ( (p) <= 7 ? 1 : (p) <= 15 ? 3 : (p) <= 23 ? 2 : 0 )
#define digitalPinToPCMSK(p)    ( (p) <= 7 ? &PCMSK1 : (p) <= 15 ? &PCMSK3 : (p) <= 23 ? &PCMSK2 : &PCMSK0 )

It seems to me that Mighty 1284P's macro is correct.

Reported at http://forum.arduino.cc/index.php?topic=262983.msg2893480#msg2893480

MCUdude added a commit that referenced this issue Aug 23, 2016
@MCUdude
Copy link
Owner

MCUdude commented Aug 23, 2016

Thanks for reporting! It should be OK now 👍

@per1234 per1234 closed this as completed Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants