OK in my Wire.h from 1.0.3 here are lines 60..63 -There is nothing in the header about mods or versions newer than "Modified 2012 by Todd Krein...".
uint8_t requestFrom(uint8_t, uint8_t);
uint8_t requestFrom(uint8_t, uint8_t, uint8_t); << line 61, this is what I am trying to use
uint8_t requestFrom(int, int);
uint8_t requestFrom(int, int, int);
So I am confused (which doesn't take much!)... how does Arduino and the compiler know which declaration to use? The 2nd would be the closest... so I first wonder how my line numbers can differ?
If I open the Wire.h from within the Arduino 1.0.3 zip, and compare: whoa! They are not the same. It would appear Teensyduino has quietly modified the libraries without leaving any comments that it did so.
Here is my Teensyduino-modified version:
#include <inttypes.h>
#include "Arduino.h" <-- line 26
...
extern "C" void i2c0_isr(void); <-- line 30, not present in original version
Original version:
#include <inttypes.h>
#include "Stream.h" <-- line 26
This begs the obvious question: when another utility (in this case Teensy) has a need to modify standard libraries like Wire.h, what is the accepted protocol? I would imagine a comment at every change, or at least in the header? Or?? As more Arduino variations are introduced how is this to be dealt with as sanely as possible?
Continuing on, there is no declaration with the "stop" parameter of type boolean as stated in the reference doc at arduino-1.0.3/reference/WireRequestFrom.html. The data type of address and quantity is not specified in the document.
Out of curiosity I try:
Wire.requestFrom(TMP102_ADDR, (uint8_t)2, (uint8_t)true); << 3rd param cast violates the ref but not Wire.h
and this seems to make my call unambiguous enough for the compiler to match up correctly.
So I am not sure why I have learned here since I don't know if this error comes from the core Wire library or the modified version. But the Wire docs also aren't consistent with the source files. So there's plenty of ambiguity...
It would seem that the included references should describe the correct data types of each function parameter. In Java, the javadoc tool takes your appropriately written source files and creates a nice clear reference doc which describes the type, use, bounds, defaults and other aspects of each parameter and return type. Is there a similar, widely accepted tool for C docs? If so I would like to write my library to utilize it and then publish the document with it.