nsh_timcmds: show RTC time in timedatectl command only if CONFIG_RTC_DRIVER is set
NuttX build fails otherwise as required structures are not included. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
parent
c699b05f74
commit
61d1f37f5f
@ -501,6 +501,7 @@ int cmd_timedatectl(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
|
||||
nsh_output(vtbl, "Universal time: %s %s\n", timbuf, tm.tm_zone);
|
||||
|
||||
#ifdef CONFIG_RTC_DRIVER
|
||||
ret = open("/dev/rtc0", O_RDONLY);
|
||||
if (ret > 0)
|
||||
{
|
||||
@ -522,6 +523,7 @@ int cmd_timedatectl(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
|
||||
nsh_output(vtbl, " RTC time: %s\n", timbuf);
|
||||
}
|
||||
#endif /* CONFIG_RTC_DRIVER */
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user