对finsh_set_device调用增加宏定义限制

This commit is contained in:
Meco Man 2021-11-24 08:57:12 -05:00
parent a3284876ff
commit bd80b7a4a1
28 changed files with 47 additions and 12 deletions

View File

@ -38,7 +38,9 @@ int main(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(FINSH_DEVICE_NAME);
#endif
#endif
rt_thread_idle_init();

View File

@ -62,7 +62,9 @@ void rtthread_startup(void)
/* init finsh */
extern int finsh_system_init(void);
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart0");
#endif
#endif
rt_system_timer_thread_init();

View File

@ -111,7 +111,9 @@ void rtthread_startup(void)
/* init finsh */
#ifdef RT_USING_FINSH
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(CONSOLE_DEVICE);
#endif
#endif
/* Initialize gui server */

View File

@ -79,7 +79,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device( FINSH_DEVICE_NAME );
#endif
#endif
/* init timer thread */

View File

@ -106,7 +106,6 @@
/* POSIX layer and C standard library */
#define RT_USING_LIBC
// #define RT_USING_POSIX
/* Network */

View File

@ -119,7 +119,7 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX) && defined(RT_USING_DEVICE)
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif

View File

@ -119,7 +119,7 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif

View File

@ -119,7 +119,7 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif

View File

@ -28,8 +28,10 @@ void rt_init_thread_entry(void *parameter)
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
#ifdef RT_USING_VBUS
rt_vbus_do_init();

View File

@ -59,8 +59,10 @@ void rt_init_thread_entry(void *parameter)
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
#ifdef RT_USING_VBUS
rt_vbus_do_init();

View File

@ -65,7 +65,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart0");
#endif
#endif
/* init timer thread */

View File

@ -25,8 +25,9 @@ void rt_init_thread_entry(void *parameter)
//finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
/**< init led device */
{

View File

@ -24,7 +24,7 @@ void rt_init_thread_entry(void *parameter)
#endif
#ifdef RT_USING_FINSH
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
(RT_CONSOLE_DEVICE_NAME);
#endif /* RT_USING_FINSH */
/**< init led device */

View File

@ -84,7 +84,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif
/* init idle thread */

View File

@ -77,7 +77,7 @@ void rtthread_startup()
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart0");
#endif
#endif

View File

@ -60,7 +60,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart");
#endif
#endif
/* init idle thread */

View File

@ -17,8 +17,10 @@ int main(void)
{
rt_thread_t thread;
#ifdef RT_USING_FINSH
#ifdef RT_USING_FINSH
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
/* Create led thread */

View File

@ -48,7 +48,7 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif

View File

@ -104,7 +104,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("sci2");
#endif
#endif
/* init soft timer thread */

View File

@ -60,8 +60,10 @@ void rt_init_thread_entry(void* parameter)
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
#ifdef RT_USING_LWIP
/* initialize lwip stack */
@ -130,7 +132,9 @@ void rt_init_thread_entry(void* parameter)
#endif
#ifdef RT_USING_FINSH
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif /* RT_USING_FINSH */
/* Filesystem Initialization */

View File

@ -114,7 +114,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif
/* init idle thread */

View File

@ -87,7 +87,9 @@ void rt_init_thread_entry(void* parameter)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif
LED_Init();

View File

@ -64,7 +64,7 @@ void rtthread_startup()
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart0");
#endif
#endif

View File

@ -53,7 +53,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart1");
#endif
#endif
/* init soft timer thread */

View File

@ -64,7 +64,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device("uart0");
#endif
#endif
/* init timer thread */

View File

@ -23,8 +23,10 @@ void rt_init_thread_entry(void *parameter)
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
}
/*the led thread*/
ALIGN(RT_ALIGN_SIZE)

View File

@ -168,7 +168,7 @@ extern struct finsh_syscall *_syscall_table_begin, *_syscall_table_end;
/* find out system call, which should be implemented in user program */
struct finsh_syscall *finsh_syscall_lookup(const char *name);
#ifdef RT_USING_DEVICE
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
void finsh_set_device(const char *device_name);
#endif

View File

@ -91,7 +91,6 @@ void finsh_set_echo(rt_uint32_t echo);
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);
int finsh_getchar(void);