| 283 | #ifdef FINSH_USING_MSH |
| 284 | #include <finsh.h> |
| 285 | static void cmd_rtc_sync(int argc, char **argv) |
| 286 | { |
| 287 | struct timeval tv = {0}; |
| 288 | struct timezone tz = {0}; |
| 289 | time_t now = (time_t)0; |
| 290 | |
| 291 | rt_soft_rtc_sync(); |
| 292 | |
| 293 | gettimeofday(&tv, &tz); |
| 294 | now = tv.tv_sec; |
| 295 | /* output current time */ |
| 296 | rt_kprintf("local time: %.*s", 25, ctime(&now)); |
| 297 | rt_kprintf("timestamps: %ld\n", (long)tv.tv_sec); |
| 298 | } |
| 299 | MSH_CMD_EXPORT_ALIAS(cmd_rtc_sync, rtc_sync, Update time by soft rtc); |
| 300 | #endif |
| 301 |
nothing calls this directly
no test coverage detected