You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-24
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# arduino-cslt
2
2
3
-
`arduino-cslt` is a convenient wrapper of [arduino-cli](https://github.com/arduino/arduino-cli), it compiles Arduino sketches outputting a precompiled library in the current working directory.
3
+
`arduino-cslt` is a convenient wrapper of [arduino-cli](https://github.com/arduino/arduino-cli), it compiles Arduino sketches outputting a precompiled library under `sketch-dist/` folder created in the current working directory.
4
4
It generates a json file in the `extras/` folder that contains information regarding libraries and core to use in order to build the sketch. The result is achieved by parsing the verbose output of `arduino-cli` and by using [GNU ar](https://sourceware.org/binutils/docs/binutils/ar.html) to generate an archive of the object files.
5
5
6
6
## Prequisites
@@ -10,7 +10,7 @@ Please use a version of the Arduino CLI that has [this](https://github.com/ardui
10
10
Another requirement is [`gcc-ar`](https://sourceware.org/binutils/docs/binutils/ar.html) (installable with `apt-get install gcc`) in your `$PATH`.
11
11
12
12
## Build it
13
-
In order to build `arduino-cslt` just use `go build`
13
+
In order to build `arduino-cslt` just use `task go:build`
14
14
15
15
## Usage
16
16
`./arduino-cslt compile -b <fqbn> <sketch_path>`
@@ -19,17 +19,17 @@ In order to build `arduino-cslt` just use `go build`
19
19
20
20
For example, running `./arduino-cslt compile -b arduino:samd:mkrwifi1010 sketch/sketch.ino` should produce a library with the following structure, in the current working directory:
21
21
```
22
-
libsketch/
23
-
├── examples
24
-
│ └── sketch
25
-
│ └── sketch.ino <-- the actual sketch we are going to compile with the arduino-cli later
26
-
├── extras
27
-
│ └── result.json
28
-
├── library.properties
29
-
└── src
30
-
├── cortex-m0plus
31
-
│ └── libsketch.a
32
-
└── libsketch.h
22
+
sketch-dist/
23
+
├── libsketch
24
+
│ ├── extras
25
+
│ │ └── result.json
26
+
│ ├── library.properties
27
+
│ └── src
28
+
│ ├── cortex-m0plus
29
+
│ │ └── libsketch.a
30
+
│ └── libsketch.h
31
+
└── sketch
32
+
└── sketch.ino <-- the actual sketch we are going to compile with the arduino-cli later
INFO[0001] created sketch-dist/libsketch/src/cortex-m0plus/libsketch.a
53
+
INFO[0001] created sketch-dist/libsketch/extras/result.json
54
54
```
55
55
56
-
And the content of `libsketch/extras/result.json` is:
56
+
And the content of `sketch-dist/libsketch/extras/result.json` is:
57
57
```json
58
58
{
59
59
"coreInfo": {
@@ -80,24 +80,24 @@ And the content of `libsketch/extras/result.json` is:
80
80
```
81
81
82
82
## How to compile the precompiled sketch
83
-
In order to compile the sketch you have first to install manually the libraries and the core listed in the `<libsketch>/extras/result.json` file.
83
+
In order to compile the sketch you have first to install manually the libraries and the core listed in the `sketch-dist/<libsketch>/extras/result.json` file.
84
84
85
85
You can install a library with [`arduino-cli lib install LIBRARY[@VERSION_NUMBER]`](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib_install/).
86
86
87
87
You can install a core with [`arduino-cli core install PACKAGER:ARCH[@VERSION]`](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_core_install/).
88
88
89
89
After completing that operation you can compile it with:
// run gcc-ar to create an archive containing all the object files except the main.cpp.o (we don't need it because we have created a substitute of it before ⬆️)
0 commit comments