对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 #ifdef RT_USING_FINSH
/* init finsh */ /* init finsh */
finsh_system_init(); finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(FINSH_DEVICE_NAME); finsh_set_device(FINSH_DEVICE_NAME);
#endif
#endif #endif
rt_thread_idle_init(); rt_thread_idle_init();

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH #ifdef RT_USING_FINSH
/* init finsh */ /* init finsh */
finsh_system_init(); 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"); finsh_set_device("uart1");
#endif #endif
#endif #endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,7 +18,9 @@ int main(void)
rt_thread_t thread; 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); finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif #endif
/* Create led thread */ /* Create led thread */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,8 +23,10 @@ void rt_init_thread_entry(void *parameter)
#ifdef RT_USING_FINSH #ifdef RT_USING_FINSH
/* initialize finsh */ /* initialize finsh */
finsh_system_init(); finsh_system_init();
#if !defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_DEVICE)
finsh_set_device(RT_CONSOLE_DEVICE_NAME); finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif #endif
#endif
} }
/*the led thread*/ /*the led thread*/
ALIGN(RT_ALIGN_SIZE) 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 */ /* find out system call, which should be implemented in user program */
struct finsh_syscall *finsh_syscall_lookup(const char *name); 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); void finsh_set_device(const char *device_name);
#endif #endif

View File

@ -91,7 +91,6 @@ void finsh_set_echo(rt_uint32_t echo);
rt_uint32_t finsh_get_echo(void); rt_uint32_t finsh_get_echo(void);
int finsh_system_init(void); int finsh_system_init(void);
void finsh_set_device(const char *device_name);
const char *finsh_get_device(void); const char *finsh_get_device(void);
int finsh_getchar(void); int finsh_getchar(void);