| 2 |
raymond |
1 |
|
|
|
2 |
This directory is intended for project specific (private) libraries.
|
|
|
3 |
PlatformIO will compile them to static libraries and link into the executable file.
|
|
|
4 |
|
|
|
5 |
The source code of each library should be placed in a separate directory
|
|
|
6 |
("lib/your_library_name/[Code]").
|
|
|
7 |
|
|
|
8 |
For example, see the structure of the following example libraries `Foo` and `Bar`:
|
|
|
9 |
|
|
|
10 |
|--lib
|
|
|
11 |
| |
|
|
|
12 |
| |--Bar
|
|
|
13 |
| | |--docs
|
|
|
14 |
| | |--examples
|
|
|
15 |
| | |--src
|
|
|
16 |
| | |- Bar.c
|
|
|
17 |
| | |- Bar.h
|
|
|
18 |
| | |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|
|
|
19 |
| |
|
|
|
20 |
| |--Foo
|
|
|
21 |
| | |- Foo.c
|
|
|
22 |
| | |- Foo.h
|
|
|
23 |
| |
|
|
|
24 |
| |- README --> THIS FILE
|
|
|
25 |
|
|
|
|
26 |
|- platformio.ini
|
|
|
27 |
|--src
|
|
|
28 |
|- main.c
|
|
|
29 |
|
|
|
30 |
Example contents of `src/main.c` using Foo and Bar:
|
|
|
31 |
```
|
|
|
32 |
#include <Foo.h>
|
|
|
33 |
#include <Bar.h>
|
|
|
34 |
|
|
|
35 |
int main (void)
|
|
|
36 |
{
|
|
|
37 |
...
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
```
|
|
|
41 |
|
|
|
42 |
The PlatformIO Library Dependency Finder will find automatically dependent
|
|
|
43 |
libraries by scanning project source files.
|
|
|
44 |
|
|
|
45 |
More information about PlatformIO Library Dependency Finder
|
|
|
46 |
- https://docs.platformio.org/page/librarymanager/ldf.html
|