px4_init:Split out console init to create null device to be used in non PX4 platform bsp (bootloadres)

This commit is contained in:
David Sidrane 2020-10-21 09:08:37 -07:00 committed by Daniel Agar
parent 021bc284c1
commit 8797823333
2 changed files with 15 additions and 2 deletions

View File

@ -34,6 +34,7 @@
__BEGIN_DECLS
int px4_platform_init(void);
int px4_platform_console_init(void);
__END_DECLS

View File

@ -42,7 +42,7 @@
#include <fcntl.h>
int px4_platform_init(void)
int px4_platform_console_init(void)
{
#if !defined(CONFIG_DEV_CONSOLE) && defined(CONFIG_DEV_NULL)
@ -75,11 +75,23 @@ int px4_platform_init(void)
}
return -ENFILE;
}
#endif
return OK;
}
int ret = px4_console_buffer_init();
int px4_platform_init(void)
{
int ret = px4_platform_console_init();
if (ret < 0) {
return ret;
}
ret = px4_console_buffer_init();
if (ret < 0) {
return ret;