PDA

View Full Version : Teensy 3 clock code change



keithg
06-13-2013, 05:31 PM
Paul,

I have been using this code for a while to set the time on my teensy 3 clock. Just upgraded to 1.0.5/teensyduino(current as of 6/13/2013). Tried to compile this code and it fails:

setSyncProvider(Teensy3Clock.get); // the function to get the time from the RT
if (set_flag == true) {
set_rtc_time();
}

It fails to compile with this error:


Arduino: 1.0.5 (Windows 7), Board: "Teensy 3.0"
Test.ino: In function 'void setup()':
Test:192: error: invalid conversion from 'long unsigned int (*)()' to 'getExternalTime {aka long int (*)()}' [-fpermissive]
In file included from Test.ino:70:0:
C:\Program Files (x86)\Arduino\libraries\Time/Time.h:134:9: error: initializing argument 1 of 'void setSyncProvider(getExternalTime)' [-fpermissive]

I am certain I just missed something recently. I copied this code from a sketch that was posted in the forum a while back on getting the onboard RTC to work. If I comment out the setSyncProvider line, it compiles and everything else works fine but it collects the wrong time. When I revert to 1.0.4 and teensyduino release version from april, it works fine.

Keith