From 31714562cc2ec3679539885b0db12596434de335 Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 25 Nov 2021 15:30:36 +0800 Subject: [shell] update the list_timer cmd. --- components/finsh/cmd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index ee8d4c7d83..2511dc6086 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -751,11 +751,11 @@ long list_timer(void) maxlen = RT_NAME_MAX; - rt_kprintf("%-*.s periodic timeout flag\n", maxlen, item_title); + rt_kprintf("%-*.s periodic timeout activated mode\n", maxlen, item_title); object_split(maxlen); - rt_kprintf(" ---------- ---------- -----------\n"); + rt_kprintf(" ---------- ---------- ----------- ---------\n"); do - { + { next = list_get_next(next, &find_arg); { int i; @@ -781,9 +781,13 @@ long list_timer(void) timer->init_tick, timer->timeout_tick); if (timer->parent.flag & RT_TIMER_FLAG_ACTIVATED) - rt_kprintf("activated\n"); + rt_kprintf("activated "); + else + rt_kprintf("deactivated "); + if (timer->parent.flag & RT_TIMER_FLAG_PERIODIC) + rt_kprintf("periodic\n"); else - rt_kprintf("deactivated\n"); + rt_kprintf("one shot\n"); } } -- cgit v1.3.1 From 75063a1b5e519d27485dac77590d46f626354ea2 Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 25 Nov 2021 15:31:43 +0800 Subject: [timer] update the RT_TIMER_CTRL_GET_STATE code in rt_timer_control --- src/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timer.c b/src/timer.c index 25ba175306..846c33263b 100644 --- a/src/timer.c +++ b/src/timer.c @@ -560,12 +560,12 @@ rt_err_t rt_timer_control(rt_timer_t timer, int cmd, void *arg) if(timer->parent.flag & RT_TIMER_FLAG_ACTIVATED) { /*timer is start and run*/ - *(rt_tick_t *)arg = RT_TIMER_FLAG_ACTIVATED; + *(rt_uint32_t *)arg = RT_TIMER_FLAG_ACTIVATED; } else { /*timer is stop*/ - *(rt_tick_t *)arg = RT_TIMER_FLAG_DEACTIVATED; + *(rt_uint32_t *)arg = RT_TIMER_FLAG_DEACTIVATED; } break; -- cgit v1.3.1 From fc72bd1f9bea9ab7f4a1a103a55fcba0baf6193d Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 25 Nov 2021 15:33:50 +0800 Subject: [shell] update the code format --- components/finsh/cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 2511dc6086..215300f20d 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -755,7 +755,7 @@ long list_timer(void) object_split(maxlen); rt_kprintf(" ---------- ---------- ----------- ---------\n"); do - { + { next = list_get_next(next, &find_arg); { int i; -- cgit v1.3.1