-
Notifications
You must be signed in to change notification settings - Fork 34
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
Undeclared identifiers digitalPinToPort
and digitalPinToBitMask
#193
Comments
Do you have any test cases for these? I'm wondering if it will be as simple as what's in https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/arduino/Arduino.h#L66 #define analogInPinToBit(P) (P)
#define digitalPinToInterrupt(P) (P) |
The test script is here. I tried adding the following to the top of
And now we have the following:
|
This is closer to what I mean in terms of use case -- I'm trying to figure out whether |
It appears that some boards use memory-mapped I/O to read/write pins. To support that we have an array that can hold pin values. A more elaborate approach would be to connect to the pin logs, but this seems like a decent first step (and allows some files to compile that didn't compile before).
An alternative fix for this would be to fiddle with Then, the In a later step, the mock pin code could maybe also look at those I/O registers so writes to them are actually processed. |
Also, I believe these definitions should be guarded by |
I have a feeling there's a better way to do a bunch of this stuff, but all I know about the Arduino codebase was gleaned by hacking my way through it for this project in particular and not by being an expert going into it. (I'm still not...) Should we open a separate issue to track whatever #197 hasn't covered (to replace this issue), or continue the discussion here? |
That can certainly be done. As to the "else" portion, should I just leave them undefined since I'm not in a position to fully implement them for every architecture? |
I've updated the code to be guarded by |
When adding Arduino CI to Adafruit_BusIO we get the following output:
Are these things that should be part of the mock Arduino?
The text was updated successfully, but these errors were encountered: