Teensy 3 clock code change

keithg

Well-known member
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:
Code:
  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:
Code:
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
 
Back
Top