mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +08:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user