Go to the documentation of this file.00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #if defined(ARDUINO) && ARDUINO >= 100
00031 #include "Arduino.h"
00032 #else
00033 #include "WProgram.h"
00034 #endif
00035 #include "osdep.h"
00036 #include "Time.h"
00037
00038 uint64_t
00039 tmr_gettime(void)
00040 {
00041 return millis();
00042 }
00043
00044 uint32_t
00045 tmr_gettime_low(void)
00046 {
00047 return (tmr_gettime() >> 0) & 0xffffffff;
00048 }
00049
00050 uint32_t
00051 tmr_gettime_high(void)
00052 {
00053 return (tmr_gettime() >> 32) & 0xffffffff;
00054 }
00055
00056 void
00057 tmr_sleep(uint32_t sleepms)
00058 {
00059 delay(sleepms);
00060 }
00061
00062 TMR_TimeStructure
00063 tmr_gettimestructure()
00064 {
00065 uint64_t temp;
00066 time_t now;
00067 TMR_TimeStructure timestructure;
00068 static tmElements_t elements;
00069
00070 temp = tmr_gettime();
00071 now = temp/1000;
00072
00073 breakTime(now, elements);
00074 timestructure.tm_year = (uint32_t)(1990 + elements.Year);
00075 timestructure.tm_mon = (uint32_t)(1 + elements.Month);
00076 timestructure.tm_mday = (uint32_t)elements.Day;
00077 timestructure.tm_hour = (uint32_t)elements.Hour;
00078 timestructure.tm_min = (uint32_t)elements.Minute;
00079 timestructure.tm_sec = (uint32_t)elements.Second;
00080 return timestructure;
00081 }