From c4f107f5288618e9930e86fc291fbdc199c9964f Mon Sep 17 00:00:00 2001 From: tyx <462747508@qq.com> Date: Tue, 5 Apr 2022 16:38:43 +0800 Subject: [PATCH] [drivers][alarm]Compact alarm output --- components/drivers/rtc/alarm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index 9cf6ae2e8b..defded2be7 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -753,21 +753,20 @@ void rt_alarm_dump(void) rt_alarm_t alarm; rt_uint8_t index = 0; - rt_kprintf("| id | YYYY-MM-DD hh:mm:ss | week | flag | en |\n"); - rt_kprintf("+----+---------------------+------+------+----+\n"); + rt_kprintf("| hh:mm:ss | week | flag | en |\n"); + rt_kprintf("+----------+------+------+----+\n"); for (next = _container.head.next; next != &_container.head; next = next->next) { alarm = rt_list_entry(next, struct rt_alarm, list); rt_uint8_t flag_index = get_alarm_flag_index(alarm->flag); - rt_kprintf("| %2d | %04d-%02d-%02d %02d:%02d:%02d | %2d | %2s | %2d |\n", - index++, alarm->wktime.tm_year + 1900, alarm->wktime.tm_mon + 1, alarm->wktime.tm_mday, + rt_kprintf("| %02d:%02d:%02d | %2d | %2s | %2d |\n", alarm->wktime.tm_hour, alarm->wktime.tm_min, alarm->wktime.tm_sec, alarm->wktime.tm_wday, _alarm_flag_tbl[flag_index].name, alarm->flag & RT_ALARM_STATE_START); } - rt_kprintf("+----+---------------------+------+------+----+\n"); + rt_kprintf("+----------+------+------+----+\n"); } -MSH_CMD_EXPORT_ALIAS(rt_alarm_dump, rt_alarm_dump, dump alarm info); +MSH_CMD_EXPORT_ALIAS(rt_alarm_dump, list_alarm, list alarm info); /** \brief initialize alarm service system *