All names of the files, classes, folders, schematics, projects - all must use CamelCase style and must have a sense and describes possibility of the code.
* Wiki
* Projects
* Software
* App
* IarProject0
* …
* IarProjectN
* QtProject0
* ….
* QtProjectN
* AndroidStudioProject0
* ….
* AndroidStudioProjectN
* Libs
* Header
* Drivers
* Platform0
* …
* PlatformN
* Module0
* …
* Source
* Drivers
* Platform0
* …
* PlatformN
* Module0
* …
* Resource
* Web
* Hardware
* AltiumProject1
* ….
* AltiumProjectN
* Examples
* Install
Note! If we use cross platform code or need to build the same code for different platform - we need to use this file "Porting.h"
The file must have some defines which will use in the different platform. The basic code is:
#inlude "stdint.h" #define WAIT(ms) delay(ms) #define ENABLE_INTERRUPT() enable_interrupt() #define DISABLE_INTERRUPT() disable_interrupt() #ifdef STM32F0 ... #else ... #endif
Note! If a IDE (Keil, Iar...) doesn't have a file with typedefs, we must use a file "Typedefs.h", it must be included only in the file "Porting.h"
Table 2.1.1
C++ | C | Python |
---|---|---|
TestFile.cpp | TestFile.c | TestFile.py |
TestFile.h | TestFile.h | - |
Must have the same name how files of the class.
NOTE! If we have a few structures, unions or class + structures we should give a name for the main class/structure how name of the header file. For other need to add the next part of the name.
Table 2.2.1 - Names of the objetcs for different Lanquage
Lanquage | Class | Structure | Unionn |
---|---|---|---|
C++ | TestObject | TestObject::MyStruct | TestObject::MyUnion |
C | TestObject - class change to structure | TestObjectMyStruct | TestObjectMyUnion |
Python | TestObject | TestObject::MyStruct | TestObject::MyUnion |
The amin class/structure/union|TestObject|TestObject | TestObject
Each name of a function/method must start from small latter and must have start part of the file name.
Table 2.3.1 - Names of the function for different Lanquage
Lanquage | Function name original | Function |
---|---|---|
C++ | setData | TestObject::setData |
C | setData | TestObject_setData |
Python | setData | TestObject::setData |
Lanquage | Local(inside function/method) | Global(static) | inside class/structure |
---|---|---|---|
C++ | l_testVariable | s_testVariable | m_testVariable |
C | l_testVariable | s_testVariable | m_testVariable |
Python | l_testVariable | s_testVariable | m_testVariable |
Note! We don't use global, external variables at all, we use only static varibles Note! Don't need to tell type of the variable, now IDE show it.
Each name of a function/method must start from small latter and must have start part of the file name.
Lanquage | Function name original | Function |
---|---|---|
C++ | setData | TestObject::setData |
C | setData | TestObject_setData |
Python | setData | TestObject::setData |
Note! Braces should start after press enter in the first letter in the line.
It should be used for all operators: if, if else, do while, for, operator, switch case ...
Note! Braces should start in the same line how a operator after one empty letter.
Example:
if (...) {
int32_t l_test = 0;
}
for (uint8_t l_counter = 0; l_counter < 3; l_counter++) {
int32_t l_test = 0;
}
while (1) {
int32_t l_temp = 0;
...
}
operator uint8_t() {
...
}
...
It should be used for all operators: if, if else, do while, for, operator, switch case ...
Note! Braces should start in the same line how a operator after one empty letter.
Follow this esp-open-rtos setup manual for install all required tools
Set path to the common.mk file in the Makefile as this
include path/to/common.mk
For more info - visit esp-open-rtos Build Process wiki page
path for toolchain: export PATH="$HOME/esp/xtensa-lx106-elf/bin/:$PATH" path for sdk : export IDF_PATH=~/esp/ESP8266_RTOS_SDK
To build firmware use the following command:
build
To flash firmware to the mk use the following command:
build flash