feat(kconfig): Add option to kconfig

Add option to enable reent function.
This commit is contained in:
Dong Heng
2018-05-08 16:02:57 +08:00
committed by Wu Jian Gang
parent f076399d45
commit 3a724ca78c
3 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,12 @@
menu "FreeRTOS"
config FREERTOS_ENABLE_REENT
bool "Enable \"reent\" function"
default n
select NEWLIB_ENABLE
help
Enable "reent" function and FreeRTOS should use "reent" function of newlib.
The configuration will enable newlib.
endmenu

View File

@ -65,6 +65,8 @@
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include "sdkconfig.h"
/*-----------------------------------------------------------
* Application specific definitions.
*
@ -140,5 +142,9 @@ configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest
NVIC value of 255. */
#define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15
#ifdef CONFIG_FREERTOS_ENABLE_REENT
#define configUSE_NEWLIB_REENTRANT 1
#endif
#endif /* FREERTOS_CONFIG_H */

41
components/newlib/Kconfig Normal file
View File

@ -0,0 +1,41 @@
menu "Newlib"
config NEWLIB_ENABLE
bool "Enable newlib"
default y
help
If you need use you own C library, make this option disable. The libraries and
header files at this component will not be used.
Note: ABI of the C library of your own must be same as SDK.
choice NEWLIB_LIBRARY_LEVEL
prompt "newlib level"
default NEWLIB_LIBRARY_LEVEL_NANO
depends on NEWLIB_ENABLE
help
Choose newlib library level.
config NEWLIB_LIBRARY_LEVEL_NORMAL
bool "normal"
help
If you need 64-bit integer formatting support or C99 features, select this
option.
config NEWLIB_LIBRARY_LEVEL_NANO
bool "nano"
help
The newlib library which has been compiled with so-called "nano"
formatting option. This option doesn't support 64-bit integer formats and C99
features, such as positional arguments.
For more details about "nano" formatting option, please see newlib readme file,
search for '--enable-newlib-nano-formatted-io':
https://sourceware.org/newlib/README
If you do not need 64-bit integer formatting support or C99 features, select this
option.
endchoice
endmenu