Pitt-RAS / micromouse-2016

7 stars 6 forks source link

I2Cdev library is patched under the same name as upstream #78

Closed ghost closed 7 years ago

ghost commented 7 years ago

Users who have upstream I2Cdev installed can't build the project.

Make a fork "I2CdevMod" and modify our code to use that instead of upstream. (Just like EncoderMod)

ghost commented 7 years ago

Also need to confirm that this is the build issue we were having, and that Arduino 1.8.0 and Teensyduino 1.34 are not the problem.

asaba96 commented 7 years ago

I can confirm that it builds just fine with Arduino 1.6.12 and teensy 1.34, as well as with Arduino 1.8.0, both times with the modified library. I believe this problem was due to the library, not the newer versions.

ghost commented 7 years ago

Confirmed working with Arduino 1.8.0 and Teensyduino 1.34 on Linux.

ghost commented 7 years ago

Whoops. In turn, the MPU9150 lib uses I2Cdev. So I'm going to have to patch that to refer to I2CdevMod.

Unless somebody has a better idea.

amiller27 commented 7 years ago

Ideally we would fix the actual problem in I2Cdevlib which prevents it from dealing with multiple i2c buses so that our solution would be backwards compatible with I2Cdevlib, but that would be hard.

ghost commented 7 years ago

Agreed.

ghost commented 7 years ago

@amiller27: I used your idea for renaming via macros. I couldn't find a way to make a conventional diff patch that renames files with changes like git does. But I was able to make concise git commits on top of upstream i2cdevlib that do the file renaming and changes all in one go. I was also able to cherry-pick our Encoder changes on top of upstream.

Here's my proposition for Encoder and I2Cdev. (MPU9150 is actually inside of the I2Cdev project upstream)

Each has an 'upstream' branch that tracks the upstream master branch, and our changes are on 'pitt-micromouse'. This puts us in a good position for dealing with future upstream changes.

Associated changes in this repo are in #85.

This was all super tedious and annoying and awful, but now I think it looks pretty good. Somebody better give me a trophy. :-)

What do you think?

amiller27 commented 7 years ago

image

This is the most nice-looking terrible hack I've ever seen