-
Notifications
You must be signed in to change notification settings - Fork 37
How to create your custom App #12
Description
When you develop an App for NuttX, you can choose if your App is an example, a system utility, can utility..
The only difference beteween the diferents options, is in which folder you save your app.
To this guide, we're going to develop the App in the example folder.
So go to: App/Examples
And create a folder with the name of your App (In this case it'll be custom_app).
Each App have four basicall file:

- custom_app_main.c : This is the main file of the project. This file have acces to:
- Header file of the driver.
- Basic C/C++ library.
- Basic NuttX library.
- You can access to other files that you add to this folder.
- Kconfig : Here you programm the options that will appear at the menuconfig, such as the description, the name, dependencies...
- Make.defs : This file add this application when it's check in menu.
- Makefile : This file is use to add the exactly file to the compilation and which options do you want to have in the App and in the system when you're run it.
Kconfig
The next image is the configuration of this App in the menu:

You can add some configuration options to your app that it'll appear in the menuconfig:

In this case you can see the options of the priority of the task when it's running the App and the stack size.
Make.defs
This file is like a linker.
Makefile
Now go to the previous folder,open the Kconfig file and add this line:
source "/home/juan/nuttxspace_add_app/apps/examples/custom_app/Kconfig"
Main file
Now everything it's setup and it's only left to program your App.
This is a basic skeleton of an empty App

(The file is already attached)
And this is a very simple example of how it works the device control in NuttX and how to apply to your app.

This app, open both sensors (Pressure and Humidity/temperature), read the value of both and show in the console.

