|
Creating an application {#creating-an-application}
|
|
Creating an application
|
|
=======================
|
|
=======================
|
|
\author Zakaria Kasmi
|
|
**Author** Zakaria Kasmi
|
|
|
|
|
|
[TOC]
|
|
\[\[_TOC_\]\]
|
|
|
|
|
|
An application can be created for full-fledged or resource-limited devices.
|
|
An application can be created for full-fledged or resource-limited devices.
|
|
|
|
|
|
Creating an application for full-fledged devices {#creating-an-application-full-fledge}
|
|
Creating an application for full-fledged devices
|
|
================================================
|
|
================================================
|
|
We recommend to use the [Eclipse IDE] (https://www.eclipse.org/) for C/C++ Developers for creating
|
|
We recommend to use the [Eclipse IDE] (https://www.eclipse.org/) for C/C++ Developers for creating
|
|
own application. The simplest way to write your own application, is to put your *.c and *.h files under the
|
|
own application. The simplest way to write your own application, is to put your *.c and *.h files under the
|
... | @@ -17,14 +17,14 @@ button to browse to the header-directory and the select the ''Apply'' and ''OK'' |
... | @@ -17,14 +17,14 @@ button to browse to the header-directory and the select the ''Apply'' and ''OK'' |
|
oriented to the main.c and the examples under the src-directory.
|
|
oriented to the main.c and the examples under the src-directory.
|
|
|
|
|
|
|
|
|
|
Creating an application for resource-limited devices {#creating-an-application-res-lim}
|
|
Creating an application for resource-limited devices
|
|
====================================================
|
|
====================================================
|
|
To create your own application for a resource limited device you need to create a directory
|
|
To create your own application for a resource limited device you need to create a directory
|
|
containing one or multiple C file(s) with your source code and a Makefile. An example Makefile is
|
|
containing one or multiple C file(s) with your source code and a Makefile. An example Makefile is
|
|
available in the `src` folder of the [RcdMathLib repository]
|
|
available in the `src` folder of the [RcdMathLib repository]
|
|
(https://git.imp.fu-berlin.de/zkasmi/my_lib_full_fledged_devices/tree/master/RcdMathLib_app).
|
|
(https://git.imp.fu-berlin.de/zkasmi/my_lib_full_fledged_devices/tree/master/RcdMathLib_app).
|
|
|
|
|
|
The main function {#the-main-function}
|
|
The main function
|
|
=================
|
|
=================
|
|
RIOT starts two threads the idle and main threads after the board is initialized.
|
|
RIOT starts two threads the idle and main threads after the board is initialized.
|
|
The idle thread has the lowest priority while the main thread has a priority that
|
|
The idle thread has the lowest priority while the main thread has a priority that
|
... | @@ -53,9 +53,9 @@ int main(void) |
... | @@ -53,9 +53,9 @@ int main(void) |
|
The above C code shows an application testing the basic operations sub-modules.
|
|
The above C code shows an application testing the basic operations sub-modules.
|
|
This application run operations of the vector and matrix sub-modules.
|
|
This application run operations of the vector and matrix sub-modules.
|
|
|
|
|
|
The application's Makefile {#the-applications-makefile}
|
|
The application's Makefile
|
|
==========================
|
|
==========================
|
|
The minimal Makefile {#the-minimal-makefile}
|
|
The minimal Makefile
|
|
--------------------
|
|
--------------------
|
|
At minimum the Makefile of an application (see @ref getting-started) needs to
|
|
At minimum the Makefile of an application (see @ref getting-started) needs to
|
|
define the following macros:
|
|
define the following macros:
|
... | @@ -89,7 +89,7 @@ include $(RCDMATHLIB)/Makefile.include |
... | @@ -89,7 +89,7 @@ include $(RCDMATHLIB)/Makefile.include |
|
include $(RIOTBASE)/Makefile.include
|
|
include $(RIOTBASE)/Makefile.include
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
Including modules {#including-modules}
|
|
Including modules
|
|
-----------------
|
|
-----------------
|
|
The modules of the RcdMathLib as well as of the RcdMathLib can be included.
|
|
The modules of the RcdMathLib as well as of the RcdMathLib can be included.
|
|
In order to use additional modules, such as a particular driver or a system library, the modules'
|
|
In order to use additional modules, such as a particular driver or a system library, the modules'
|
... | | ... | |