The way to add new libraries in NuttX is pretty similar to Linux.
Also the libraries written for Linux are in majority of the case totally compatible with NuttX, only been necessary some minor modifications.
The .c files of the libraries are save in NuttX/libcs.
To add the new library to the compilation you must go to:
NuttX\libc\Makefile and add the next line:
include folder_name_library/Make.defs
Then, inside the folder, you must create the file Make.defs.
Inside this file you can add the files that you want to compile, and the option that must be check to compile it. Like this example:
ifneq ($(LIBM_ARCH_RINT),y)
CSRCS += library_file.c
endif
Also you must add the dependency folder:
DEPPATH += --dep-path library
VPATH += :library
Then to add the .h files, go to:
NuttX\include\lib_folder
And inside the folder, add the .h files.
Your library is now include.
The way to add new libraries in NuttX is pretty similar to Linux.
Also the libraries written for Linux are in majority of the case totally compatible with NuttX, only been necessary some minor modifications.
The .c files of the libraries are save in NuttX/libcs.
To add the new library to the compilation you must go to:
NuttX\libc\Makefile and add the next line:
include folder_name_library/Make.defs
Then, inside the folder, you must create the file Make.defs.
Inside this file you can add the files that you want to compile, and the option that must be check to compile it. Like this example:
Also you must add the dependency folder:
Then to add the .h files, go to:
NuttX\include\lib_folder
And inside the folder, add the .h files.
Your library is now include.