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
In the following thread over the Arduino Forum we identified that ConfigurableFirmata did not upload properly onto an UNO R4 Wifi board. At first a DHT sensor library dependency was flagged as being needed to be installed which I did separately. But then the following error came about:
In file included from /Users/jules/Library/Arduino15/packages/arduino/hardware/renesas_uno/1.2.0/cores/arduino/Arduino.h:124:0,
from /Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/utility/Boards.h:23,
from /Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/ConfigurableFirmata.h:18,
from /Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/AnalogOutputFirmata.cpp:19:
/Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/AnalogOutputFirmata.cpp: In member function 'virtual boolean AnalogOutputFirmata::handlePinMode(byte, int)':
/Users/jules/Library/Arduino15/packages/arduino/hardware/renesas_uno/1.2.0/variants/UNOWIFIR4/pins_arduino.h:93:30: error: 'IS_PIN_PWM' was not declared in this scope
#define digitalPinHasPWM(p) (IS_PIN_PWM(getPinCfgs(p, PIN_CFG_REQ_PWM)[0]))
^
/Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/utility/Boards.h:817:33: note: in expansion of macro 'digitalPinHasPWM'
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
^~~~~~~~~~~~~~~~
/Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/AnalogOutputFirmata.cpp:41:33: note: in expansion of macro 'IS_PIN_PWM'
if (mode == PIN_MODE_PWM && IS_PIN_PWM(pin)) {
^~~~~~~~~~
/Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/AnalogOutputFirmata.cpp: In member function 'virtual void AnalogOutputFirmata::handleCapability(byte)':
/Users/jules/Library/Arduino15/packages/arduino/hardware/renesas_uno/1.2.0/variants/UNOWIFIR4/pins_arduino.h:93:30: error: 'IS_PIN_PWM' was not declared in this scope
#define digitalPinHasPWM(p) (IS_PIN_PWM(getPinCfgs(p, PIN_CFG_REQ_PWM)[0]))
^
/Users/jules/Documents/Arduino/libraries/ConfigurableFirmata/src/utility/Boards.h:817:33: note: in expansion of macro 'digitalPinHasPWM'
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
Thanks to @ptillisch on the Arduino Forum, they provided me with a temporary patch to correct the issue which was:
within the Arduino/libraries/ConfigurableFirmata/src/utility/Boards.h
replace line 817 #define IS_PIN_PWM(p) digitalPinHasPWM(p)
This helped unblock the issue but not a good permanent fix as they explained:
The problem is that there is a macro named IS_PIN_PWM in the UNO R4 WiFi board's [Arduino core library]
(https://arduino.github.io/arduino-cli/latest/platform-specification/#cores):
line 76: #define IS_PIN_PWM(x) (((x & PIN_USE_MASK) == PIN_PWM_GPT) || ((x & PIN_USE_MASK) == PIN_PWM_AGT))
but the ConfigurableFirmata library also uses a macro of the same name:
line 817: #define IS_PIN_PWM(p) digitalPinHasPWM(p)
The person who added support for the UNO R4 WiFi board attempted to work around that macro name collision by undefining the core's macro before defining the library's macro:
line 811: // These have conflicting(?) definitions in the core for this CPU
line 812: #undef IS_PIN_PWM
However, that doesn't work because the digitalPinHasPWM macro uses the IS_PIN_PWM macro:
line 93: #define digitalPinHasPWM(p) (IS_PIN_PWM(getPinCfgs(p, PIN_CFG_REQ_PWM)[0]))
@ptillisch worked around this by duplicating all the code from the core for the digitalPinHasPWM macro definition, including the code for the core's IS_PIN_PWM macro.
@ptillisch thinks that a better solution would be to change the name of the ConfigurableFirmata library's IS_PIN_PWM macro to something more unique (e.g., CONFIGURABLE_FIRMATA_IS_PIN_PWM) so that it won't collide with the macro of the same name in the UNO R4 WiFi board's core. However, this solution does require updating all references to the macro throughout the library so it is more complex to apply to the library.
Hope this helps :)
Thank you for the help
The text was updated successfully, but these errors were encountered:
In the following thread over the Arduino Forum we identified that ConfigurableFirmata did not upload properly onto an UNO R4 Wifi board. At first a
DHT sensor library
dependency was flagged as being needed to be installed which I did separately. But then the following error came about:Thanks to @ptillisch on the Arduino Forum, they provided me with a temporary patch to correct the issue which was:
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
This helped unblock the issue but not a good permanent fix as they explained:
The problem is that there is a macro named IS_PIN_PWM in the UNO R4 WiFi board's [Arduino core library]
(https://arduino.github.io/arduino-cli/latest/platform-specification/#cores):
line 76:
#define IS_PIN_PWM(x) (((x & PIN_USE_MASK) == PIN_PWM_GPT) || ((x & PIN_USE_MASK) == PIN_PWM_AGT))
but the ConfigurableFirmata library also uses a macro of the same name:
line 817:
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
The person who added support for the UNO R4 WiFi board attempted to work around that macro name collision by undefining the core's macro before defining the library's macro:
line 811:
// These have conflicting(?) definitions in the core for this CPU
line 812:
#undef IS_PIN_PWM
However, that doesn't work because the digitalPinHasPWM macro uses the IS_PIN_PWM macro:
line 93:
#define digitalPinHasPWM(p) (IS_PIN_PWM(getPinCfgs(p, PIN_CFG_REQ_PWM)[0]))
@ptillisch worked around this by duplicating all the code from the core for the digitalPinHasPWM macro definition, including the code for the core's IS_PIN_PWM macro.
@ptillisch thinks that a better solution would be to change the name of the ConfigurableFirmata library's IS_PIN_PWM macro to something more unique (e.g., CONFIGURABLE_FIRMATA_IS_PIN_PWM) so that it won't collide with the macro of the same name in the UNO R4 WiFi board's core. However, this solution does require updating all references to the macro throughout the library so it is more complex to apply to the library.
Hope this helps :)
Thank you for the help
The text was updated successfully, but these errors were encountered: