diff options
| author | Shell <[email protected]> | 2024-05-17 13:19:00 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-17 13:19:00 +0800 |
| commit | f2d6325b43ea1e390f034e03340b41662351b441 (patch) | |
| tree | 8933d6e52221a7f642148addac77750ef7dbc3a3 /components/lwp/lwp.c | |
| parent | 3d30b56c8631ed3b5fa5fbda71d1ef21853afc9d (diff) | |
[smart] select console device dynamically (#8949)
* [smart] select console device dynamically
- Fixed compiler warning on terminal subsystem for
`components/lwp/terminal/terminal.h`
- Updated default console setup to dynamically select an appropriate tty
device based on the configured console device name.
Signed-off-by: Shell <[email protected]>
* fixup: remove useless codes
---------
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'components/lwp/lwp.c')
| -rw-r--r-- | components/lwp/lwp.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index 87629cc890..c33bbfdc5f 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -17,7 +17,7 @@ */ #define DBG_TAG "lwp" -#define DBG_LVL DBG_WARNING +#define DBG_LVL DBG_INFO #include <rtdbg.h> #include <rthw.h> @@ -62,29 +62,6 @@ static const char elf_magic[] = {0x7f, 'E', 'L', 'F'}; extern char working_directory[]; #endif -/** - * @brief The default console is only a backup device with lowest priority. - * It's always recommended to scratch the console from the boot arguments. - * And dont forget to register the device with a higher priority. - */ -static rt_err_t lwp_default_console_setup(void) -{ - rt_device_t bakdev = rt_device_find("ttyS0"); - rt_err_t rc; - - if (bakdev) - { - lwp_console_register_backend(bakdev, LWP_CONSOLE_LOWEST_PRIOR); - rc = RT_EOK; - } - else - { - rc = -RT_EINVAL; - } - - return rc; -} - static int lwp_component_init(void) { int rc; @@ -104,10 +81,6 @@ static int lwp_component_init(void) { LOG_E("%s: lwp_futex_init() failed", __func__); } - else if ((rc = lwp_default_console_setup()) != RT_EOK) - { - LOG_E("%s: lwp_default_console_setup() failed", __func__); - } return rc; } INIT_COMPONENT_EXPORT(lwp_component_init); |
