13
13
14
14
#include <zephyr/sys/timeutil.h>
15
15
16
- #if defined(CONFIG_ARCH_POSIX ) && defined(CONFIG_EXTERNAL_LIBC )
17
- #include <time.h>
18
- #else
19
- #include <zephyr/posix/time.h>
20
- #endif
21
-
22
16
#define HELP_NONE "[none]"
23
17
#define HELP_DATE_SET "[Y-m-d] <H:M:S>"
24
18
@@ -144,7 +138,7 @@ static int cmd_date_set(const struct shell *sh, size_t argc, char **argv)
144
138
struct tm tm ;
145
139
int ret ;
146
140
147
- clock_gettime ( CLOCK_REALTIME , & tp );
141
+ sys_clock_gettime ( SYS_CLOCK_REALTIME , & tp );
148
142
149
143
gmtime_r (& tp .tv_sec , & tm );
150
144
@@ -177,7 +171,7 @@ static int cmd_date_set(const struct shell *sh, size_t argc, char **argv)
177
171
}
178
172
tp .tv_nsec = 0 ;
179
173
180
- ret = clock_settime ( CLOCK_REALTIME , & tp );
174
+ ret = sys_clock_settime ( SYS_CLOCK_REALTIME , & tp );
181
175
if (ret != 0 ) {
182
176
shell_error (sh , "Could not set date %d" , ret );
183
177
return - EINVAL ;
@@ -193,7 +187,7 @@ static int cmd_date_get(const struct shell *sh, size_t argc, char **argv)
193
187
struct timespec tp ;
194
188
struct tm tm ;
195
189
196
- clock_gettime ( CLOCK_REALTIME , & tp );
190
+ sys_clock_gettime ( SYS_CLOCK_REALTIME , & tp );
197
191
198
192
gmtime_r (& tp .tv_sec , & tm );
199
193
0 commit comments