From a4818ad3ddf41a742395efbc35fcc938ddcc9312 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Mon, 12 Jul 2021 18:21:04 +0800 Subject: Fix error code and return value. --- components/drivers/hwcrypto/hw_symmetric.c | 7 ++----- components/net/at/at_socket/at_socket.c | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'components') diff --git a/components/drivers/hwcrypto/hw_symmetric.c b/components/drivers/hwcrypto/hw_symmetric.c index 9398298fed..ffa5eca451 100644 --- a/components/drivers/hwcrypto/hw_symmetric.c +++ b/components/drivers/hwcrypto/hw_symmetric.c @@ -55,7 +55,8 @@ rt_err_t rt_hwcrypto_symmetric_crypt(struct rt_hwcrypto_ctx *ctx, hwcrypto_mode struct hwcrypto_symmetric_info symmetric_info; rt_err_t err; - if (ctx == RT_NULL) + if ((ctx == RT_NULL) || + (mode != HWCRYPTO_MODE_ENCRYPT && mode != HWCRYPTO_MODE_DECRYPT)) { return -RT_EINVAL; } @@ -64,10 +65,6 @@ rt_err_t rt_hwcrypto_symmetric_crypt(struct rt_hwcrypto_ctx *ctx, hwcrypto_mode { return -RT_ERROR; } - if (mode != HWCRYPTO_MODE_ENCRYPT && mode != HWCRYPTO_MODE_DECRYPT) - { - return -EINVAL; - } /* Input information packaging */ symmetric_info.mode = mode; diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index 973be0acf4..cc3e26ed47 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -1100,7 +1101,7 @@ static uint32_t ipstr_to_u32(char *ipstr) struct hostent *at_gethostbyname(const char *name) { struct at_device *device = RT_NULL; - ip_addr_t addr; + ip_addr_t addr = {0}; char ipstr[16] = { 0 }; /* buffer variables for at_gethostbyname() */ static struct hostent s_hostent; -- cgit v1.3.1 From dc1f2631eeed552d6bf9466297315ca940ee389b Mon Sep 17 00:00:00 2001 From: ousugo Date: Tue, 23 Nov 2021 16:05:17 +0800 Subject: Add dataqueue.c function annotation --- components/drivers/src/dataqueue.c | 68 +++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index f32efa1849..be4883d954 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -21,6 +21,19 @@ struct rt_data_item rt_size_t data_size; }; +/** + * @brief This function will initialize a data queue.Calling this function will + * initialize the data queue control block and set the notification callback function. + * + * @param queue The data queue object + * @param size The maximum number of data in the data queue + * @param lwm Low water mark, when the number of data in the data queue is less than this value, + * will wake up the thread waiting for write data. + * @param evt_notify The notification callback function + * + * @return the operation status, RT_EOK on successful, + * RT_ENOMEM on insufficient memory allocation failed. + */ rt_err_t rt_data_queue_init(struct rt_data_queue *queue, rt_uint16_t size, @@ -32,7 +45,7 @@ rt_data_queue_init(struct rt_data_queue *queue, queue->evt_notify = evt_notify; - queue->magic = DATAQUEUE_MAGIC; + queue->magic = DATAQUEUE_MAGIC; queue->size = size; queue->lwm = lwm; @@ -54,6 +67,17 @@ rt_data_queue_init(struct rt_data_queue *queue, } RTM_EXPORT(rt_data_queue_init); +/** + * @brief This function will write data to the data queue. If the data queue is full, + * the thread will suspend for the specified amount of time. + * + * @param queue The data queue object + * @param data_ptr The buffer pointer of the data to be written + * @param size The size in bytes of the data to be written + * @param timeout The waiting time + * + * @return the operation status, RT_EOK on successful + */ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, const void *data_ptr, rt_size_t data_size, @@ -153,6 +177,20 @@ __exit: } RTM_EXPORT(rt_data_queue_push); +/** + * @brief This function will pop data from the data queue. If the data queue is empty, + * the thread will suspend for the specified amount of time. + * + * @attention when the number of data in the data queue is less than lwm(low water mark), + * will wake up the thread waiting for write data. + * + * @param queue The data queue object + * @param data_ptr The buffer pointer of the data to be fetched + * @param size The size in bytes of the data to be fetched + * @param timeout The waiting time + * + * @return Operation status, RT_EOK on successful, RT_ETIMEOUT on timeout. + */ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, const void** data_ptr, rt_size_t *size, @@ -264,6 +302,15 @@ __exit: } RTM_EXPORT(rt_data_queue_pop); +/** + * @brief This function will fetching but retaining data in the data queue. + * + * @param queue The data queue object + * @param data_ptr The buffer pointer of the data to be fetched + * @param size The size in bytes of the data to be fetched + * + * @return The operation status, RT_EOK on successful + */ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, const void** data_ptr, rt_size_t *size) @@ -289,6 +336,12 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, } RTM_EXPORT(rt_data_queue_peek); +/** + * @brief Reset a data queue. Calling this function will wake up all threads on the data queue + * that are hanging and waiting. + * + * @param queue The data queue object + */ void rt_data_queue_reset(struct rt_data_queue *queue) { rt_ubase_t level; @@ -362,6 +415,13 @@ void rt_data_queue_reset(struct rt_data_queue *queue) } RTM_EXPORT(rt_data_queue_reset); +/** + * @brief Deinit a data queue. + * + * @param queue The data queue object + * + * @return operation status, RT_EOK on successful. + */ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) { rt_ubase_t level; @@ -382,6 +442,12 @@ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) } RTM_EXPORT(rt_data_queue_deinit); +/** + * @brief This function get the number of data in the data queue. + * + * @param queue The data queue object + * @return The number of data in the data queue + */ rt_uint16_t rt_data_queue_len(struct rt_data_queue *queue) { rt_ubase_t level; -- cgit v1.3.1 From afdbee97ed139800e02441bd80efa4f8b8976aa2 Mon Sep 17 00:00:00 2001 From: ousugo Date: Tue, 23 Nov 2021 16:40:55 +0800 Subject: fix extra space --- components/drivers/src/dataqueue.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index be4883d954..4e51d72865 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -22,16 +22,16 @@ struct rt_data_item }; /** - * @brief This function will initialize a data queue.Calling this function will + * @brief This function will initialize a data queue.Calling this function will * initialize the data queue control block and set the notification callback function. - * + * * @param queue The data queue object * @param size The maximum number of data in the data queue * @param lwm Low water mark, when the number of data in the data queue is less than this value, * will wake up the thread waiting for write data. * @param evt_notify The notification callback function - * - * @return the operation status, RT_EOK on successful, + * + * @return the operation status, RT_EOK on successful, * RT_ENOMEM on insufficient memory allocation failed. */ rt_err_t @@ -45,7 +45,7 @@ rt_data_queue_init(struct rt_data_queue *queue, queue->evt_notify = evt_notify; - queue->magic = DATAQUEUE_MAGIC; + queue->magic = DATAQUEUE_MAGIC; queue->size = size; queue->lwm = lwm; @@ -70,13 +70,13 @@ RTM_EXPORT(rt_data_queue_init); /** * @brief This function will write data to the data queue. If the data queue is full, * the thread will suspend for the specified amount of time. - * + * * @param queue The data queue object * @param data_ptr The buffer pointer of the data to be written * @param size The size in bytes of the data to be written * @param timeout The waiting time - * - * @return the operation status, RT_EOK on successful + * + * @return the operation status, RT_EOK on successful */ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, const void *data_ptr, @@ -180,15 +180,15 @@ RTM_EXPORT(rt_data_queue_push); /** * @brief This function will pop data from the data queue. If the data queue is empty, * the thread will suspend for the specified amount of time. - * + * * @attention when the number of data in the data queue is less than lwm(low water mark), * will wake up the thread waiting for write data. - * + * * @param queue The data queue object * @param data_ptr The buffer pointer of the data to be fetched * @param size The size in bytes of the data to be fetched * @param timeout The waiting time - * + * * @return Operation status, RT_EOK on successful, RT_ETIMEOUT on timeout. */ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, @@ -304,12 +304,12 @@ RTM_EXPORT(rt_data_queue_pop); /** * @brief This function will fetching but retaining data in the data queue. - * + * * @param queue The data queue object * @param data_ptr The buffer pointer of the data to be fetched * @param size The size in bytes of the data to be fetched - * - * @return The operation status, RT_EOK on successful + * + * @return The operation status, RT_EOK on successful */ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, const void** data_ptr, @@ -339,7 +339,7 @@ RTM_EXPORT(rt_data_queue_peek); /** * @brief Reset a data queue. Calling this function will wake up all threads on the data queue * that are hanging and waiting. - * + * * @param queue The data queue object */ void rt_data_queue_reset(struct rt_data_queue *queue) @@ -417,9 +417,9 @@ RTM_EXPORT(rt_data_queue_reset); /** * @brief Deinit a data queue. - * + * * @param queue The data queue object - * + * * @return operation status, RT_EOK on successful. */ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) @@ -444,9 +444,9 @@ RTM_EXPORT(rt_data_queue_deinit); /** * @brief This function get the number of data in the data queue. - * + * * @param queue The data queue object - * @return The number of data in the data queue + * @return The number of data in the data queue */ rt_uint16_t rt_data_queue_len(struct rt_data_queue *queue) { -- cgit v1.3.1 From a1cc3d43e71819b3f12c3673187b6316d083ef6c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 23 Nov 2021 22:38:00 -0500 Subject: modify time.h to sys/time.h --- bsp/bluetrum/libraries/hal_drivers/drv_rtc.c | 1 - bsp/ck802/libraries/include/drv_rtc.h | 2 +- bsp/ft2004/libraries/bsp/ft_i2c/ft_i2c_selftest.c | 2 +- bsp/imxrt/libraries/drivers/drv_rtc.c | 2 +- bsp/lpc5410x/Libraries/lpc_chip/chip_common/rtc_ut.h | 2 +- bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h | 2 +- bsp/swm320-lq100/applications/main.c | 2 +- bsp/swm320/applications/main.c | 2 +- components/drivers/include/drivers/alarm.h | 3 ++- components/drivers/rtc/rtc.c | 2 +- examples/kernel/event_simple.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'components') diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c b/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c index 56c75aae59..fab2d749a8 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_rtc.c @@ -11,7 +11,6 @@ */ #include "board.h" -#include #include #ifdef BSP_USING_ONCHIP_RTC diff --git a/bsp/ck802/libraries/include/drv_rtc.h b/bsp/ck802/libraries/include/drv_rtc.h index 182b3df843..b393f13fda 100644 --- a/bsp/ck802/libraries/include/drv_rtc.h +++ b/bsp/ck802/libraries/include/drv_rtc.h @@ -29,7 +29,7 @@ extern "C" { #include #include -#include +#include /// definition for rtc handle. typedef void *rtc_handle_t; diff --git a/bsp/ft2004/libraries/bsp/ft_i2c/ft_i2c_selftest.c b/bsp/ft2004/libraries/bsp/ft_i2c/ft_i2c_selftest.c index 4a43df0ce4..4be275e9ce 100644 --- a/bsp/ft2004/libraries/bsp/ft_i2c/ft_i2c_selftest.c +++ b/bsp/ft2004/libraries/bsp/ft_i2c/ft_i2c_selftest.c @@ -12,7 +12,7 @@ * ----- ------     --------    -------------------------------------- */ -#include +#include #include #include "ft_i2c_hw.h" #include "ft_i2c.h" diff --git a/bsp/imxrt/libraries/drivers/drv_rtc.c b/bsp/imxrt/libraries/drivers/drv_rtc.c index 96ae1006fa..d3f86c5e42 100644 --- a/bsp/imxrt/libraries/drivers/drv_rtc.c +++ b/bsp/imxrt/libraries/drivers/drv_rtc.c @@ -20,7 +20,7 @@ #include "drv_rtc.h" #include "fsl_snvs_hp.h" -#include +#include #if defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL #error "Please don't define 'FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL'!" diff --git a/bsp/lpc5410x/Libraries/lpc_chip/chip_common/rtc_ut.h b/bsp/lpc5410x/Libraries/lpc_chip/chip_common/rtc_ut.h index c88ca598ae..9caffc2dd6 100644 --- a/bsp/lpc5410x/Libraries/lpc_chip/chip_common/rtc_ut.h +++ b/bsp/lpc5410x/Libraries/lpc_chip/chip_common/rtc_ut.h @@ -36,7 +36,7 @@ #include "chip.h" #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h index 4af28efa17..35ccaf39d5 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include "bcm283x.h" struct rt_rtc_device diff --git a/bsp/swm320-lq100/applications/main.c b/bsp/swm320-lq100/applications/main.c index 3761e8c14d..5685bf6745 100644 --- a/bsp/swm320-lq100/applications/main.c +++ b/bsp/swm320-lq100/applications/main.c @@ -169,7 +169,7 @@ MSH_CMD_EXPORT(pwm_sample, pwm sample); #endif #ifdef RT_USING_RTC -#include +#include static int rtc_sample(int argc, char *argv[]) { rt_err_t ret = RT_EOK; diff --git a/bsp/swm320/applications/main.c b/bsp/swm320/applications/main.c index 4b42c4936a..0ebd6663f6 100644 --- a/bsp/swm320/applications/main.c +++ b/bsp/swm320/applications/main.c @@ -169,7 +169,7 @@ MSH_CMD_EXPORT(pwm_sample, pwm sample); #endif #ifdef RT_USING_RTC -#include +#include static int rtc_sample(int argc, char *argv[]) { rt_err_t ret = RT_EOK; diff --git a/components/drivers/include/drivers/alarm.h b/components/drivers/include/drivers/alarm.h index 11637df949..56822b72e1 100644 --- a/components/drivers/include/drivers/alarm.h +++ b/components/drivers/include/drivers/alarm.h @@ -13,7 +13,8 @@ #ifndef __ALARM_H__ #define __ALARM_H__ -#include +#include +#include #define RT_ALARM_TM_NOW -1 /* set the alarm tm_day,tm_mon,tm_sec,etc. to now.we also call it "don't care" value */ diff --git a/components/drivers/rtc/rtc.c b/components/drivers/rtc/rtc.c index 0658d2aaf4..39f82499f5 100644 --- a/components/drivers/rtc/rtc.c +++ b/components/drivers/rtc/rtc.c @@ -14,7 +14,7 @@ * 2021-07-30 Meco Man move rtc_core.c to rtc.c */ -#include +#include #include #include #include diff --git a/examples/kernel/event_simple.c b/examples/kernel/event_simple.c index 8b2f966d3d..78887b6aea 100644 --- a/examples/kernel/event_simple.c +++ b/examples/kernel/event_simple.c @@ -15,7 +15,7 @@ * 一个线程定时发送事件 (事件5) */ #include -#include +#include #include "tc_comm.h" /* 指向线程控制块的指针 */ -- cgit v1.3.1 From 2c2a1fe64ee1e03ffbac9df9ec452cc00e18df0c Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 24 Nov 2021 14:14:45 +0800 Subject: Update annotation format --- components/drivers/src/dataqueue.c | 93 ++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 39 deletions(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index 4e51d72865..fcaa8f379d 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -22,17 +22,21 @@ struct rt_data_item }; /** - * @brief This function will initialize a data queue.Calling this function will - * initialize the data queue control block and set the notification callback function. + * @brief This function will initialize a data queue.Calling this function will + * initialize the data queue control block and set the notification callback function. * - * @param queue The data queue object - * @param size The maximum number of data in the data queue - * @param lwm Low water mark, when the number of data in the data queue is less than this value, - * will wake up the thread waiting for write data. - * @param evt_notify The notification callback function + * @param queue is a pointer to a data queue object. * - * @return the operation status, RT_EOK on successful, - * RT_ENOMEM on insufficient memory allocation failed. + * @param size is the maximum number of data in the data queue. + * + * @param lwm is low water mark. + * When the number of data in the data queue is less than this value,will + * wake up the thread waiting for write data. + * + * @param evt_notify is the notification callback function. + * + * @return Return the operation status. When the return value is RT_EOK, the initialization is successful. + * When the return value is RT_ENOMEM, it means insufficient memory allocation failed. */ rt_err_t rt_data_queue_init(struct rt_data_queue *queue, @@ -68,15 +72,18 @@ rt_data_queue_init(struct rt_data_queue *queue, RTM_EXPORT(rt_data_queue_init); /** - * @brief This function will write data to the data queue. If the data queue is full, - * the thread will suspend for the specified amount of time. + * @brief This function will write data to the data queue. If the data queue is full, + * the thread will suspend for the specified amount of time. * - * @param queue The data queue object - * @param data_ptr The buffer pointer of the data to be written - * @param size The size in bytes of the data to be written - * @param timeout The waiting time + * @param queue is a pointer to a data queue object. + * . + * @param data_ptr is the buffer pointer of the data to be written. * - * @return the operation status, RT_EOK on successful + * @param size is the size in bytes of the data to be written. + * + * @param timeout is the waiting time. + * + * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, const void *data_ptr, @@ -178,18 +185,21 @@ __exit: RTM_EXPORT(rt_data_queue_push); /** - * @brief This function will pop data from the data queue. If the data queue is empty, - * the thread will suspend for the specified amount of time. + * @brief This function will pop data from the data queue. If the data queue is empty,the thread + * will suspend for the specified amount of time. + * + * @note when the number of data in the data queue is less than lwm(low water mark),will + * wake up the thread waiting for write data. * - * @attention when the number of data in the data queue is less than lwm(low water mark), - * will wake up the thread waiting for write data. + * @param queue is a pointer to a data queue object. * - * @param queue The data queue object - * @param data_ptr The buffer pointer of the data to be fetched - * @param size The size in bytes of the data to be fetched - * @param timeout The waiting time + * @param data_ptr is the buffer pointer of the data to be fetched. * - * @return Operation status, RT_EOK on successful, RT_ETIMEOUT on timeout. + * @param size is the size in bytes of the data to be fetched. + * + * @param timeout is the waiting time. + * + * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, const void** data_ptr, @@ -303,13 +313,15 @@ __exit: RTM_EXPORT(rt_data_queue_pop); /** - * @brief This function will fetching but retaining data in the data queue. + * @brief This function will fetching but retaining data in the data queue. + * + * @param queue is a pointer to a data queue object. * - * @param queue The data queue object - * @param data_ptr The buffer pointer of the data to be fetched - * @param size The size in bytes of the data to be fetched + * @param data_ptr is the buffer pointer of the data to be fetched. * - * @return The operation status, RT_EOK on successful + * @param size is the size in bytes of the data to be fetched. + * + * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, const void** data_ptr, @@ -337,10 +349,12 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, RTM_EXPORT(rt_data_queue_peek); /** - * @brief Reset a data queue. Calling this function will wake up all threads on the data queue - * that are hanging and waiting. + * @brief This function will reset a data queue. + * + * @note Calling this function will wake up all threads on the data queue + * that are hanging and waiting. * - * @param queue The data queue object + * @param queue is a pointer to a data queue object. */ void rt_data_queue_reset(struct rt_data_queue *queue) { @@ -416,11 +430,11 @@ void rt_data_queue_reset(struct rt_data_queue *queue) RTM_EXPORT(rt_data_queue_reset); /** - * @brief Deinit a data queue. + * @brief This function will deinit a data queue. * - * @param queue The data queue object + * @param queue is a pointer to a data queue object. * - * @return operation status, RT_EOK on successful. + * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) { @@ -443,10 +457,11 @@ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) RTM_EXPORT(rt_data_queue_deinit); /** - * @brief This function get the number of data in the data queue. + * @brief This function will get the number of data in the data queue. + * + * @param queue is a pointer to a data queue object. * - * @param queue The data queue object - * @return The number of data in the data queue + * @return Return the number of data in the data queue. */ rt_uint16_t rt_data_queue_len(struct rt_data_queue *queue) { -- cgit v1.3.1 From 1deaa8fe50949580aaba53df3f8f0b07e259e879 Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 24 Nov 2021 14:19:25 +0800 Subject: Update annotation format --- components/drivers/src/dataqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index fcaa8f379d..d13378a507 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -188,7 +188,7 @@ RTM_EXPORT(rt_data_queue_push); * @brief This function will pop data from the data queue. If the data queue is empty,the thread * will suspend for the specified amount of time. * - * @note when the number of data in the data queue is less than lwm(low water mark),will + * @note when the number of data in the data queue is less than lwm(low water mark), will * wake up the thread waiting for write data. * * @param queue is a pointer to a data queue object. -- cgit v1.3.1 From 02ca44bf1f1f56bf9ea3864a095f48da3ad827b5 Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 24 Nov 2021 15:21:30 +0800 Subject: Fix annotation grammatical mistake --- components/drivers/src/dataqueue.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index d13378a507..c23c34b484 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -22,15 +22,15 @@ struct rt_data_item }; /** - * @brief This function will initialize a data queue.Calling this function will + * @brief This function will initialize the data queue.Calling this function will * initialize the data queue control block and set the notification callback function. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * * @param size is the maximum number of data in the data queue. * * @param lwm is low water mark. - * When the number of data in the data queue is less than this value,will + * When the number of data in the data queue is less than this value, this function will * wake up the thread waiting for write data. * * @param evt_notify is the notification callback function. @@ -75,7 +75,7 @@ RTM_EXPORT(rt_data_queue_init); * @brief This function will write data to the data queue. If the data queue is full, * the thread will suspend for the specified amount of time. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * . * @param data_ptr is the buffer pointer of the data to be written. * @@ -188,10 +188,10 @@ RTM_EXPORT(rt_data_queue_push); * @brief This function will pop data from the data queue. If the data queue is empty,the thread * will suspend for the specified amount of time. * - * @note when the number of data in the data queue is less than lwm(low water mark), will + * @note When the number of data in the data queue is less than lwm(low water mark), will * wake up the thread waiting for write data. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * * @param data_ptr is the buffer pointer of the data to be fetched. * @@ -313,9 +313,9 @@ __exit: RTM_EXPORT(rt_data_queue_pop); /** - * @brief This function will fetching but retaining data in the data queue. + * @brief This function will fetch but retaining data in the data queue. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * * @param data_ptr is the buffer pointer of the data to be fetched. * @@ -349,12 +349,12 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, RTM_EXPORT(rt_data_queue_peek); /** - * @brief This function will reset a data queue. + * @brief This function will reset the data queue. * * @note Calling this function will wake up all threads on the data queue * that are hanging and waiting. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. */ void rt_data_queue_reset(struct rt_data_queue *queue) { @@ -430,9 +430,9 @@ void rt_data_queue_reset(struct rt_data_queue *queue) RTM_EXPORT(rt_data_queue_reset); /** - * @brief This function will deinit a data queue. + * @brief This function will deinit the data queue. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */ @@ -459,7 +459,7 @@ RTM_EXPORT(rt_data_queue_deinit); /** * @brief This function will get the number of data in the data queue. * - * @param queue is a pointer to a data queue object. + * @param queue is a pointer to the data queue object. * * @return Return the number of data in the data queue. */ -- cgit v1.3.1 From 2ef0d40aff71d6cd8fee7af6babca689aae621a2 Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 24 Nov 2021 21:59:37 +0800 Subject: Fix space --- components/drivers/src/dataqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index c23c34b484..1f7971a367 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -22,7 +22,7 @@ struct rt_data_item }; /** - * @brief This function will initialize the data queue.Calling this function will + * @brief This function will initialize the data queue. Calling this function will * initialize the data queue control block and set the notification callback function. * * @param queue is a pointer to the data queue object. -- cgit v1.3.1 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(-) (limited to 'components') 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 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(-) (limited to 'components') 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 From b329611e3547d663b7914cb5966f1a849470c264 Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 1 Dec 2021 14:43:53 +0800 Subject: Update annotation --- components/drivers/src/dataqueue.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'components') diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index 1f7971a367..4e52662c44 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -84,6 +84,7 @@ RTM_EXPORT(rt_data_queue_init); * @param timeout is the waiting time. * * @return Return the operation status. When the return value is RT_EOK, the operation is successful. + * When the return value is RT_ETIMEOUT, it means the specified time out. */ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, const void *data_ptr, @@ -200,6 +201,7 @@ RTM_EXPORT(rt_data_queue_push); * @param timeout is the waiting time. * * @return Return the operation status. When the return value is RT_EOK, the operation is successful. + * When the return value is RT_ETIMEOUT, it means the specified time out. */ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, const void** data_ptr, @@ -322,6 +324,7 @@ RTM_EXPORT(rt_data_queue_pop); * @param size is the size in bytes of the data to be fetched. * * @return Return the operation status. When the return value is RT_EOK, the operation is successful. + * When the return value is -RT_EEMPTY, it means the data queue is empty. */ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, const void** data_ptr, -- cgit v1.3.1