File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,36 @@ int add_iso8601_utc_datetime(char *buf, size_t size)
148148 return strftime (buf , size , "%Y-%m-%dT%H:%M:%SZ" , & timeinfo );
149149}
150150
151+ #elif defined(ARDUINO )
152+
153+ #ifndef _TIMEVAL_DEFINED
154+ struct timeval {
155+ long tv_sec ; // seconds since epoch
156+ long tv_usec ; // microseconds
157+ };
158+ #endif
159+
160+ #ifndef _TIMEZONE_DEFINED
161+ struct timezone {
162+ int tz_minuteswest ; // minutes west of UTC
163+ int tz_dsttime ; // daylight saving time flag
164+ };
165+ #endif
166+
167+ int gettimeofday (struct timeval * tp , struct timezone * tzp )
168+ {
169+ ARG_UNUSED (tzp );
170+ tp -> tv_sec = micros () / 1000000 ;
171+ tp -> tv_usec = micros () % 1000000 ;
172+ return 0 ;
173+ }
174+
175+ int add_iso8601_utc_datetime (char * buf , size_t size ) {
176+ ARG_UNUSED (buf );
177+ ARG_UNUSED (size );
178+ return 0 ;
179+ }
180+
151181#elif defined(__BARE_METAL__ )
152182
153183#ifndef _TIMEVAL_DEFINED
You can’t perform that action at this time.
0 commit comments