In the WebClientRepeating sample code for the Ethernet library there is a line for determining the posting interval. The line is
const unsigned long postingInterval = 60*1000; // delay between updates, in milliseconds
The problem is the actual value of the postingInterval is wrong when I print it out. It seems to be a casting/overflow problem with the compiler/preprocessor.
I broke this out into very short sample code to demonstrate:
const unsigned long postingInterval = 60*1000;
const unsigned long postingIntervalB = (long)60*1000;
void setup() {
Serial.begin(9600);
Serial.println(postingInterval);
Serial.println(postingIntervalB);
}
void loop() {}
When I run this I get back the following values:
4294961760
60000
The first value is obviously incorrect while the second one is fine. What bothers me is this was happening in the Ethernet library sample code and the httprequest function was never called because of such a high postingInterval value.
Has this been posted before and I just didn't see it in the forum (I got back a ton of unrelated results when searching). Or is something weird going on with my three Arduino installs?