retrolefty:
Well progress it seems. I didn't really know what I was doing but your last change (the lenght * 2) did seem to be the source of the compiler errors...
Eureka! Good call on that fix, and I'm glad you have something to work with now. I did compile it in my avr-gcc-based project, which currently has an incomplete TwoWire implementation hacked together. It worked fine there, but I didn't test it in the Arduino sketch until this morning, at which point the error you mentioned showed up. The problem was that the TwoWire::requestFrom() method has at least two unique parameter lists (a.k.a. it's overloaded), which are:
TwoWire::requestFrom(uint8_t, uint8_t);
TwoWire::requestFrom(int, int);
I believe that second (int, int) one is equivalent to (int16_t, int16_t) using C99 types. Basically, one uses unsigned 8-bit integer, and one uses signed 16-bit integers. The call I have in the I2Cdev::readWords() method uses a specifically declared uint8_t length variable, which was fine up until I added that inline "length * 2" as an argument. If you take an 8-bit integer and multiply it by two, you might end up with a 9-bit value, which would need to be stored in a 16-bit integer container (since the only viable options are 8-bit and 16-bit, and it obviously won't fit in an 8-bit one). Once this potential data type conversion takes place, the function is called like this:
TwoWire::requestFrom(uint8_t, int);
...which is not one of the candidates, and requires another conversion of the first parameter to make it work. It could go in either direction, trying to fit (and potentially clip) a 9-bit unsigned integer into an 8-bit unsigned container (uint8_t, uint8_t), or it could expand the unsigned 8-bit first parameter into a larger signed 16-bit container (int, int). Apparently ISO C++ doesn't like to make such a choice arbitrarily.
So, because the length variable is really supposed to contain the number of words that you want, and your fix changes it permanently to the number of bytes, I left it the way I had it and typecast it back into an unsigned 8-bit value:
Wire.requestFrom(devAddr, (uint8_t)(length * 2)); // length=words, this wants bytes
Problem solved, and pushed to the repository. The only caveat here is that you can't request more than 127 words at a time. I have no idea whether this is a legitimate concern, but with the devices in the library so far, it isn't even remotely close to being a problem.
Jeff