You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All Arduino cores I have seen so far stick to this, CubeCell is the only exception. This leads to issues if the user decides to create his own class that contains a pinMode member function. For example, try to compile the following sketch:
classMyClass {
public:MyClass() {};
voidpinMode(int a, int b) { _a = a; _b = b; };
private:int _a, _b;
};
voidsetup() {
// put your setup code here, to run once:
}
voidloop() {
// put your main code here, to run repeatedly:
}
The preprocessor will attempt to replace the MyClass::pinMode() method, which will obviously then fail to build. This is causing incompatibility in my projects and is one of the reasons I wasn't able to support CubeCell in RadioLib.
The only workaround is to not use pinMode as a name for anything, which seems rather silly.
The text was updated successfully, but these errors were encountered:
Hi,
it seems that currently,
pinMode()
is a macro, as defined inCubeCell-Arduino/cores/asr650x/Arduino.h
Line 87 in e15d5fd
However, Arduino API specifies it should be a function in the global scope: https://github.com/arduino/ArduinoCore-API/blob/e03b65374c614130aa1b11597e07b3b5089a726d/api/Common.h#L95
All Arduino cores I have seen so far stick to this, CubeCell is the only exception. This leads to issues if the user decides to create his own class that contains a
pinMode
member function. For example, try to compile the following sketch:The preprocessor will attempt to replace the
MyClass::pinMode()
method, which will obviously then fail to build. This is causing incompatibility in my projects and is one of the reasons I wasn't able to support CubeCell in RadioLib.The only workaround is to not use
pinMode
as a name for anything, which seems rather silly.The text was updated successfully, but these errors were encountered: