-
-
Notifications
You must be signed in to change notification settings - Fork 86
[ArduinoEigen] Pin Definitions Conflict with Sketch/Library Variables when used with ArduinoCore-renesas #50
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
Hi @mjs513 ☕ 👋 How many libraries does that actually affect? Do you know of other libraries? I suggest to keep things in perspective 😉 . That being said your desired change seems reasonable to me (I'd replace |
@aentinger
|
How about you prepare a PR so that we can jointly take a look? 🙏 😉 For info how to do so, see here. |
@aentinger - PR Submitted - as I mentioned I am leary of signing a CLA as I never have had to in the past for any other projects or PRs I submitted for other open source projects. |
Going to close this issue since its taken care of with the PR. |
Provide abstract base class HardwareCAN (prepare for ArduinoCore-API).
Provide abstract base class HardwareCAN (prepare for ArduinoCore-API). Former-commit-id: 3200e28
I posted this as well on the forum but may be better suited here: https://forum.arduino.cc/t/pin-definitions-conflict-with-sketch-library-variables/1147341
Many libraries (such as Eigen) and sketches may use variables such as A0-A5 and D0-D15 as variables versus pins definitions in pins_arduino.h:
So if you run a simple sketch:
it will throw an error:
A more complex example would be using Eigen:
In file included from
C:\Users\Merli\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.2\cores\arduino/Arduino.h:125:0,
from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\019E3DD99F1ECF6C34FCED459E6CC679\sketch\eigen_example.ino.cpp:1:
d:\Users\Merli\Documents\Arduino\libraries\eigen-main\src/Eigen/src/Core/products/GeneralBlockPanelKernel.h: In member function 'void Eigen::internal::lhs_process_one_packet<nr, LhsProgress, RhsProgress, LhsScalar, RhsScalar, ResScalar, AccPacket, LhsPacket, RhsPacket, ResPacket, GEBPTraits, LinearMapper, DataMapper>::operator()(const DataMapper&, const LhsScalar*, const RhsScalar*, ResScalar, Eigen::Index, Eigen::Index, Eigen::Index, Eigen::Index, Eigen::Index, Eigen::Index, int, Eigen::Index, Eigen::Index, Eigen::Index, Eigen::Index, Eigen::Index)':
C:\Users\Merli\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.2\variants\MINIMA/pins_arduino.h:56:16: error: lvalue required as unary '&' operand
#define D0 (0u)
^
d:\Users\Merli\Documents\Arduino\libraries\eigen-main\src/Eigen/src/Core/products/GeneralBlockPanelKernel.h:1270:73: note: in expansion of macro 'D0'
peeled_kc_onestep(1, blA, blB, traits, &A1, &rhs_panel, &T0, &D0, &D1, &D2, &D3);
^~
........
only one many errors. To correct this pins_arduino.h can be changed to (same way you did it for the analog pins):
this gets rid of the error messages in the same sketch and when using the Eigen Library for instance. I did test eigen with the recommended changes and it works.
EDIT: Would have to do for both the Wifi and Minima Version
The text was updated successfully, but these errors were encountered: