arduino-libraries / WiFiNINA

136 stars 105 forks source link

Definition of SET_PIN_MODE in global namespace clashes with popular Firmata library #233

Open mphasize opened 1 year ago

mphasize commented 1 year ago

Hi there,

I've been trying for a while to compile either https://github.com/firmata/arduino or https://github.com/firmata/ConfigurableFirmata on the Arduino MKR WIFI 1010.

Unfortunately there seems to be a clash with the definition of SET_PIN_MODE in the global namespace here: https://github.com/arduino-libraries/WiFiNINA/blob/094856b05a80ea2f79cf956c6ac5ff6715546db5/src/utility/wifi_spi.h#L102

The issue is also discussed here: https://github.com/firmata/arduino/issues/470

Any ideas, how this could be solved?

mphasize commented 1 year ago

A simple workaround is renaming SET_PIN_MODE to something else, as it is only used 3 times in the codebase. With this approach I could compile WiFiNINA and Firmata together and can get also create a working example.

Unfortunately, this is probably a somewhat unstable fix, but I don't know enough about C/C++ to refactor the code with a namespace.