diff options
| author | liukangcc <[email protected]> | 2021-09-17 15:03:14 +0800 |
|---|---|---|
| committer | liukangcc <[email protected]> | 2021-09-17 15:03:14 +0800 |
| commit | 4b3df6010f7870aebcd1df20bbaabd5fe9212c6d (patch) | |
| tree | 95b0e12447425f803be46d16eaf6e7188c364fec /components/drivers | |
| parent | f07507a91310bc5696a08f5bbf6ab8679cfbcf73 (diff) | |
| parent | ef71de34f76d4403fcd2cddd21a17f3a53a40296 (diff) | |
Merge remote-tracking branch 'remotes/rtt_github/master'
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/can/can.c | 3 | ||||
| -rw-r--r-- | components/drivers/include/drivers/cputime.h | 2 | ||||
| -rw-r--r-- | components/drivers/include/drivers/pm.h | 1 | ||||
| -rw-r--r-- | components/drivers/include/drivers/serial.h | 7 | ||||
| -rw-r--r-- | components/drivers/include/ipc/ringblk_buf.h | 5 | ||||
| -rw-r--r-- | components/drivers/phy/phy.c | 2 | ||||
| -rw-r--r-- | components/drivers/rtc/alarm.c | 2 | ||||
| -rw-r--r-- | components/drivers/rtc/rtc.c | 7 | ||||
| -rw-r--r-- | components/drivers/serial/serial.c | 4 | ||||
| -rw-r--r-- | components/drivers/serial/serial_v2.c | 2 | ||||
| -rw-r--r-- | components/drivers/src/pipe.c | 2 | ||||
| -rw-r--r-- | components/drivers/src/ringblk_buf.c | 4 | ||||
| -rw-r--r-- | components/drivers/wlan/wlan_cmd.c | 2 |
13 files changed, 29 insertions, 14 deletions
diff --git a/components/drivers/can/can.c b/components/drivers/can/can.c index 55444c3a0e..358220013f 100644 --- a/components/drivers/can/can.c +++ b/components/drivers/can/can.c @@ -966,6 +966,5 @@ int cmd_canstat(int argc, void **argv) } return 0; } -FINSH_FUNCTION_EXPORT_ALIAS(cmd_canstat, __cmd_canstat, Stat Can Device Status.); +MSH_CMD_EXPORT_ALIAS(cmd_canstat, canstat, stat can device status); #endif - diff --git a/components/drivers/include/drivers/cputime.h b/components/drivers/include/drivers/cputime.h index 0141f24805..26a1e40f8e 100644 --- a/components/drivers/include/drivers/cputime.h +++ b/components/drivers/include/drivers/cputime.h @@ -11,6 +11,8 @@ #ifndef CPUTIME_H__ #define CPUTIME_H__ +#include <stdint.h> + struct rt_clock_cputime_ops { float (*cputime_getres) (void); diff --git a/components/drivers/include/drivers/pm.h b/components/drivers/include/drivers/pm.h index 51bff54ebb..d38c0a4e2a 100644 --- a/components/drivers/include/drivers/pm.h +++ b/components/drivers/include/drivers/pm.h @@ -15,6 +15,7 @@ #ifndef __PM_H__ #define __PM_H__ +#include <stdint.h> #include <rtthread.h> #ifndef PM_HAS_CUSTOM_CONFIG diff --git a/components/drivers/include/drivers/serial.h b/components/drivers/include/drivers/serial.h index c2e951e9b1..f0d0edbfad 100644 --- a/components/drivers/include/drivers/serial.h +++ b/components/drivers/include/drivers/serial.h @@ -77,6 +77,9 @@ #define RT_SERIAL_TX_DATAQUEUE_SIZE 2048 #define RT_SERIAL_TX_DATAQUEUE_LWM 30 +#define RT_SERIAL_FLOWCONTROL_CTSRTS 1 +#define RT_SERIAL_FLOWCONTROL_NONE 0 + /* Default config for serial_configure structure */ #define RT_SERIAL_CONFIG_DEFAULT \ { \ @@ -87,6 +90,7 @@ BIT_ORDER_LSB, /* LSB first sent */ \ NRZ_NORMAL, /* Normal mode */ \ RT_SERIAL_RB_BUFSZ, /* Buffer size */ \ + RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \ 0 \ } @@ -100,7 +104,8 @@ struct serial_configure rt_uint32_t bit_order :1; rt_uint32_t invert :1; rt_uint32_t bufsz :16; - rt_uint32_t reserved :6; + rt_uint32_t flowcontrol :1; + rt_uint32_t reserved :5; }; /* diff --git a/components/drivers/include/ipc/ringblk_buf.h b/components/drivers/include/ipc/ringblk_buf.h index 5b2971b800..df05659f3e 100644 --- a/components/drivers/include/ipc/ringblk_buf.h +++ b/components/drivers/include/ipc/ringblk_buf.h @@ -76,9 +76,12 @@ typedef struct rt_rbb *rt_rbb_t; /* rbb (ring block buffer) API */ void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t block_set, rt_size_t blk_max_num); +rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb); + +#ifdef RT_USING_HEAP rt_rbb_t rt_rbb_create(rt_size_t buf_size, rt_size_t blk_max_num); void rt_rbb_destroy(rt_rbb_t rbb); -rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb); +#endif /* rbb block API */ rt_rbb_blk_t rt_rbb_blk_alloc(rt_rbb_t rbb, rt_size_t blk_size); diff --git a/components/drivers/phy/phy.c b/components/drivers/phy/phy.c index 6d408ce612..87152a306e 100644 --- a/components/drivers/phy/phy.c +++ b/components/drivers/phy/phy.c @@ -8,7 +8,7 @@ * Date Author Notes * 2020-09-27 wangqiang first version */ - +#include <stddef.h> #include <rthw.h> #include <rtthread.h> #include <rtdevice.h> diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index cd0a976328..2bcc51f2ee 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -777,7 +777,7 @@ void rt_alarm_dump(void) rt_kprintf("+----+---------------------+------+------+----+\n"); } -FINSH_FUNCTION_EXPORT_ALIAS(rt_alarm_dump, __cmd_alarm_dump, dump alarm info); +MSH_CMD_EXPORT_ALIAS(rt_alarm_dump, rt_alarm_dump, dump alarm info); /** \brief initialize alarm service system * diff --git a/components/drivers/rtc/rtc.c b/components/drivers/rtc/rtc.c index 35e7ddc3c4..bc75c83e7d 100644 --- a/components/drivers/rtc/rtc.c +++ b/components/drivers/rtc/rtc.c @@ -223,7 +223,7 @@ rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second) /** * get date and time or set (local timezone) [year month day hour min sec] */ -static void date(uint8_t argc, char **argv) +static void date(int argc, char **argv) { if (argc == 1) { @@ -235,8 +235,9 @@ static void date(uint8_t argc, char **argv) else if (argc >= 7) { /* set time and date */ - uint16_t year; - uint8_t month, day, hour, min, sec; + rt_uint16_t year; + rt_uint8_t month, day, hour, min, sec; + year = atoi(argv[1]); month = atoi(argv[2]); day = atoi(argv[3]); diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 97068b30aa..289d523bd2 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -38,7 +38,7 @@ #ifdef RT_USING_POSIX #include <dfs_posix.h> -#include <dfs_poll.h> +#include <poll.h> #include <sys/ioctl.h> #ifdef RT_USING_POSIX_TERMIOS @@ -1112,6 +1112,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev, break; case TCXONC: break; +#endif /*RT_USING_POSIX_TERMIOS*/ case TIOCSWINSZ: { struct winsize* p_winsize; @@ -1202,7 +1203,6 @@ static rt_err_t rt_serial_control(struct rt_device *dev, p_winsize->ws_ypixel = 0;/* unused */ } break; -#endif /*RT_USING_POSIX_TERMIOS*/ case FIONREAD: { rt_size_t recved = 0; diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index 6e65457a5d..390dd31748 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -18,7 +18,7 @@ #ifdef RT_USING_POSIX #include <dfs_posix.h> -#include <dfs_poll.h> +#include <poll.h> #include <sys/ioctl.h> #ifdef getc diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 7fa5eb067d..af90f13c6f 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -16,7 +16,7 @@ #ifdef RT_USING_POSIX #include <dfs_file.h> #include <dfs_posix.h> -#include <dfs_poll.h> +#include <poll.h> #include <sys/ioctl.h> static int pipe_fops_open(struct dfs_fd *fd) diff --git a/components/drivers/src/ringblk_buf.c b/components/drivers/src/ringblk_buf.c index c6688b3d2b..b966da3d36 100644 --- a/components/drivers/src/ringblk_buf.c +++ b/components/drivers/src/ringblk_buf.c @@ -44,6 +44,8 @@ void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t } RTM_EXPORT(rt_rbb_init); +#ifdef RT_USING_HEAP + /** * ring block buffer object create * @@ -102,6 +104,8 @@ void rt_rbb_destroy(rt_rbb_t rbb) } RTM_EXPORT(rt_rbb_destroy); +#endif + static rt_rbb_blk_t find_empty_blk_in_set(rt_rbb_t rbb) { rt_size_t i; diff --git a/components/drivers/wlan/wlan_cmd.c b/components/drivers/wlan/wlan_cmd.c index 3b8a119784..52c25f6755 100644 --- a/components/drivers/wlan/wlan_cmd.c +++ b/components/drivers/wlan/wlan_cmd.c @@ -587,7 +587,7 @@ static int wifi_msh(int argc, char *argv[]) } #if defined(RT_USING_FINSH) -FINSH_FUNCTION_EXPORT_ALIAS(wifi_msh, __cmd_wifi, wifi command.); +MSH_CMD_EXPORT_ALIAS(wifi_msh, wifi, wifi command); #endif #endif |
