-
Notifications
You must be signed in to change notification settings - Fork 53
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
digitalPinToInterrupt seems not to be defined for chipKIT MAX32 #406
Comments
I expect its because digitalPinToInterrupt is not defined at |
It is actually a functionality that is lacking from the core completely, and is something that crossed my mind last night whilst putting together a board configuration for a new board - we really need to implement digitalPinToInterrupt in the core. |
As it is most board definitions have defines for |
Implementing it in the core is a simple one-liner. However then doing the board-level work is going to be an onerous task. I have done it in testing for the MAX32: void setup() {
Serial.begin(115200);
for (int i = 0; i < NUM_DIGITAL_PINS; i++) {
if (digitalPinToInterrupt(i) != NOT_INT_PIN) {
Serial.printf("Pin %d has interrupt number %d\r\n", i, digitalPinToInterrupt(i));
}
}
}
void loop() {
} now gives:
but I need to now go through each and every board and implement it. Boards that don't have it implemented will return NOT_INT_PIN (i.e., 0xFF) for every pin. Looks like I have a fun weekend ahead of me. |
Actually, I may have come up with a better, more generic, method of implementing it that uses the |
Generically fixed in #407 - individual boards may need tweaks after testing. |
If this works Matt then I can truly declare you as a god among men.
Jacob
Jacob Christ
*ProLinear/PONTECH, Inc.*
+1 (909) 481-6672 Phone
http://www.pontech.com
…On Sat, May 19, 2018 at 4:06 AM, Majenko Technologies < ***@***.***> wrote:
Generically fixed in #407
<#407> - individual boards
may need tweaks after testing.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#406 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMGa4ez9xK_PT9an4o5wZSRum3zVOEwks5tz_yjgaJpZM4UFpe7>
.
|
I just found the exact same code written by someone else in some of the board definitions (great minds... ;) ) - so I have removed it to prevent redefinition warnings. |
Using the sketc:
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
digitalPinToInterrupt(3);
}
works for Mega 2560 but if i switch to chipKIT MAX32 following error occur:
C:\Users\ENTWPIC\AppData\Local\Temp\arduino_modified_sketch_234261\libeval.ino: In function 'void loop()':
libeval:11: error: 'digitalPinToInterrupt' was not declared in this scope
digitalPinToInterrupt(3);
exit status 255
'digitalPinToInterrupt' was not declared in this scope
The text was updated successfully, but these errors were encountered: