felias-fogg / FlexWire

A Wire-alike library that can be used as a drop-in for the Wire library
https://arduino-craft-corner.de/index.php/2023/11/29/replacing-the-wire-library-sometimes/
GNU Lesser General Public License v2.1
4 stars 0 forks source link

Compile error on ESP32 in Adafruit_I2CDevice.cpp #2

Open Neophyte69 opened 7 months ago

Neophyte69 commented 7 months ago

I am using an ESP32 Dev Board, and trying to include RTCLib.h, which, via the Adafruit_I2CDevice, includes Wire.h

I then moved the ESP32 Wire.h folder from the ESP32 installation folder to a temp folder on another drive.

This allowed compilation to go further than original Wire.h, however, it now fails on the Adafruit_I2CDevice.cpp with the errors below:

`c:\Users\Jacques\Documents\Arduino\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp: In constructor 'Adafruit_I2CDevice::Adafruit_I2CDevice(uint8_t, TwoWire*)': c:\Users\xxxxxxx\Documents\Arduino\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:17:20: error: 'I2C_BUFFER_LENGTH' was not declared in this scope _maxBufferSize = I2C_BUFFER_LENGTH; ^~~~~ c:\Users\Jacques\Documents\Arduino\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:17:20: note: suggested alternative: 'BUFFER_LENGTH' _maxBufferSize = I2C_BUFFER_LENGTH; ^~~~~ BUFFER_LENGTH

exit status 1

Compilation error: exit status 1`

felias-fogg commented 7 months ago

Hi,

with the new version V1.2.0 it should work. You can download the new version from the repo. It should be available soon via the Arduino library manager.

And I believe that you do not need to move the original Wire.h library. It should be enough to exit and restart the Arduino IDE in order to clear the compilation cache, where potentially an older compiled version of the original Wire library has been stored. At least, that worked in my case.

Best, Bernhard