Closed theozaurus closed 9 years ago
Wouldn't this tend to cause confusion? If I add a Wire.h file then since Wire.h matches multiple files in the include path (original Arduino and also compatibility folder) it will depend on the directory search order to determine which one gets used (for different toolchain setup one may get a different compile result). In a way, it redirects editing the #include line to editing the include path, but either way something needs to be edited. I'll think about it more.
I think this would reduce confusion. Users who are unable to adapt their includes would never risk loading the library (they cannot add i2c_t3/compatibility to the include path). People who can adjust their includes and need to simply add i2c_t3/compatibility.
You're right about the search order being important, but if you have the ability to add i2c_t3/compatibility then you should be able to remove the
A further improvement could be to move the code that sets the Wire constant outside of the i2c_t3. This would give you an extremely flexible setup.
What do you think?
I didn't forget about this. I'll study it on the toolchains I work with and see what people think about it on the PJRC forums.
Cool! Look forward to hearing other peoples ideas on it.
Sorry, have to close this as incompatible with Arduino build (specifically Teensyduino since this lib is Teensy focused). There was a recent workaround discussion here: https://forum.pjrc.com/threads/21680-New-I2C-library-for-Teensy3?p=79995&viewfull=1#post79995 If you would like to propose alternate workarounds please consider posting to that thread (I think it has more viewers than GitHub).
Thanks for writing i2c_t3, it works a treat.
I'm currently trying to integrate it into my own project that uses CMake to control the toolchain. It would be really handy to add this file as it would mean other libraries could use the i2c_t3 lib without alteration if the compatibility folder is added to the include path.