File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,18 @@ int weak_function up_timer_gettick(FAR clock_t *ticks)
241
241
242
242
return ret ;
243
243
}
244
+
245
+ int weak_function up_timer_gettime (struct timespec * ts )
246
+ {
247
+ int ret = - EAGAIN ;
248
+
249
+ if (g_oneshot_lower != NULL )
250
+ {
251
+ ret = ONESHOT_CURRENT (g_oneshot_lower , ts );
252
+ }
253
+
254
+ return ret ;
255
+ }
244
256
#endif
245
257
246
258
/****************************************************************************
Original file line number Diff line number Diff line change @@ -283,6 +283,20 @@ int weak_function up_timer_gettick(FAR clock_t *ticks)
283
283
284
284
return ret ;
285
285
}
286
+
287
+ int weak_function up_timer_gettime (struct timespec * ts )
288
+ {
289
+ int ret = - EAGAIN ;
290
+
291
+ if (g_timer .lower != NULL )
292
+ {
293
+ ts -> tv_sec = current_usec () / USEC_PER_SEC ;
294
+ ts -> tv_nsec = (current_usec () % USEC_PER_SEC ) * NSEC_PER_USEC ;
295
+ ret = OK ;
296
+ }
297
+
298
+ return ret ;
299
+ }
286
300
#endif
287
301
288
302
/****************************************************************************
You can’t perform that action at this time.
0 commit comments