summaryrefslogtreecommitdiff
path: root/components/finsh
diff options
context:
space:
mode:
authorchenyingchun0312 <[email protected]>2021-08-23 18:54:03 +0800
committerchenyingchun0312 <[email protected]>2021-08-23 18:54:03 +0800
commit39689ea5edfca9dc267cfa125b99d4d86a8a20bd (patch)
tree446d9f9d2f7a374f62f06524b36e0cc7cfb7bc24 /components/finsh
parent5e02709c5533b5741b7ae8eae4945c8c43f86beb (diff)
parentf0c963bf53e03c19bce171c6d52c9a39440cf7c0 (diff)
Merge branch 'develop' of https://github.com/chenyingchun0312/rt-thread into develop
Diffstat (limited to 'components/finsh')
-rw-r--r--components/finsh/cmd.c2
-rw-r--r--components/finsh/shell.c8
-rw-r--r--components/finsh/shell.h1
3 files changed, 7 insertions, 4 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c
index 9bbcc440cf..fd08246fa5 100644
--- a/components/finsh/cmd.c
+++ b/components/finsh/cmd.c
@@ -810,6 +810,7 @@ static char *const device_type_str[] =
"I2C Bus",
"USB Slave Device",
"USB Host Bus",
+ "USB OTG Bus",
"SPI Bus",
"SPI Device",
"SDIO Bus",
@@ -821,6 +822,7 @@ static char *const device_type_str[] =
"Sensor Device",
"Touch Device",
"Phy Device",
+ "Security Device",
"Unknown"
};
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index c89139c0ed..87dc6e0745 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -164,7 +164,7 @@ void finsh_set_prompt_mode(rt_uint32_t prompt_mode)
shell->prompt_mode = prompt_mode;
}
-static int finsh_getchar(void)
+char finsh_getchar(void)
{
#ifdef RT_USING_DEVICE
#ifdef RT_USING_POSIX
@@ -176,7 +176,7 @@ static int finsh_getchar(void)
while (rt_device_read(shell->device, -1, &ch, 1) != 1)
rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);
- return (int)ch;
+ return ch;
#endif
#else
extern char rt_hw_console_getchar(void);
@@ -329,7 +329,7 @@ static void finsh_wait_auth(void)
while (1)
{
/* read one character from device */
- ch = finsh_getchar();
+ ch = (int)finsh_getchar();
if (ch < 0)
{
continue;
@@ -541,7 +541,7 @@ void finsh_thread_entry(void *parameter)
while (1)
{
- ch = finsh_getchar();
+ ch = (int)finsh_getchar();
if (ch < 0)
{
continue;
diff --git a/components/finsh/shell.h b/components/finsh/shell.h
index 6a4dfff113..6a2737f422 100644
--- a/components/finsh/shell.h
+++ b/components/finsh/shell.h
@@ -97,6 +97,7 @@ rt_uint32_t finsh_get_echo(void);
int finsh_system_init(void);
void finsh_set_device(const char* device_name);
const char* finsh_get_device(void);
+char finsh_getchar(void);
rt_uint32_t finsh_get_prompt_mode(void);
void finsh_set_prompt_mode(rt_uint32_t prompt_mode);