implement set_timeval

This commit is contained in:
Meco Man
2021-04-15 14:01:55 +08:00
parent 6d7dafe090
commit 8e2a456d7a
3 changed files with 130 additions and 68 deletions
+4 -1
View File
@@ -40,7 +40,7 @@ struct timeval {
#endif
#endif /* _TIMEVAL_DEFINED */
#if !(defined(__GNUC__) && !defined(__ARMCC_VERSION)) && !defined (__ICCARM__) && !defined (_WIN32)
#if !(defined(__GNUC__) && !defined(__ARMCC_VERSION)/*GCC*/) && !defined (__ICCARM__) && !defined (_WIN32)
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
@@ -56,6 +56,9 @@ int stime(const time_t *t);
time_t timegm(struct tm * const t);
int gettimeofday(struct timeval *tv, struct timezone *tz);
int settimeofday(const struct timeval *tv, const struct timezone *tz);
#if defined(__ARMCC_VERSION) || defined (__ICCARM__)
struct tm *gmtime_r(const time_t *timep, struct tm *r);
#endif
#ifdef RT_USING_POSIX
#include <sys/types.h>
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -964,10 +964,10 @@ enum rt_device_class_type
#define RT_DEVICE_CTRL_MTD_FORMAT 0x10 /**< format a MTD device */
#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10 /**< get second time */
#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11 /**< set second time */
#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x12 /**< get alarm */
#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x13 /**< set alarm */
#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x14 /**< get microsecond time */
#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x15 /**< set microsecond time */
#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12 /**< get microsecond time */
#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13 /**< set microsecond time */
#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14 /**< get alarm */
#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15 /**< set alarm */
typedef struct rt_device *rt_device_t;