fastled 1.1.45__py3-none-any.whl → 1.1.66__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastled/__init__.py +1 -1
- fastled/app.py +1 -0
- fastled/cli.py +3 -0
- fastled/parse_args.py +6 -6
- fastled/project_init.py +9 -2
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/METADATA +28 -25
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/RECORD +11 -11
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/LICENSE +0 -0
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/WHEEL +0 -0
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/entry_points.txt +0 -0
- {fastled-1.1.45.dist-info → fastled-1.1.66.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
fastled/app.py
CHANGED
fastled/cli.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
Main entry point.
|
3
3
|
"""
|
4
4
|
|
5
|
+
import multiprocessing
|
5
6
|
import sys
|
6
7
|
|
7
8
|
from fastled.app import main as app_main
|
@@ -12,5 +13,7 @@ def main() -> int:
|
|
12
13
|
return app_main()
|
13
14
|
|
14
15
|
|
16
|
+
# Cli entry point for the pyinstaller generated exe
|
15
17
|
if __name__ == "__main__":
|
18
|
+
multiprocessing.freeze_support() # needed by pyinstaller.
|
16
19
|
sys.exit(main())
|
fastled/parse_args.py
CHANGED
@@ -18,9 +18,7 @@ from fastled.sketch import (
|
|
18
18
|
def parse_args() -> argparse.Namespace:
|
19
19
|
"""Parse command-line arguments."""
|
20
20
|
parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
|
21
|
-
parser.add_argument(
|
22
|
-
"--version", action="version", version=f"{__version__}"
|
23
|
-
)
|
21
|
+
parser.add_argument("--version", action="version", version=f"{__version__}")
|
24
22
|
parser.add_argument(
|
25
23
|
"directory",
|
26
24
|
type=str,
|
@@ -30,8 +28,9 @@ def parse_args() -> argparse.Namespace:
|
|
30
28
|
)
|
31
29
|
parser.add_argument(
|
32
30
|
"--init",
|
33
|
-
|
34
|
-
|
31
|
+
nargs="?",
|
32
|
+
const=True,
|
33
|
+
help="Initialize the FastLED sketch in the current directory. Optional name can be provided",
|
35
34
|
)
|
36
35
|
parser.add_argument(
|
37
36
|
"--just-compile",
|
@@ -105,7 +104,8 @@ def parse_args() -> argparse.Namespace:
|
|
105
104
|
args = parser.parse_args()
|
106
105
|
|
107
106
|
if args.init:
|
108
|
-
args.
|
107
|
+
example = args.init if args.init is not True else None
|
108
|
+
args.directory = project_init(example)
|
109
109
|
print("\nInitialized FastLED project in", args.directory)
|
110
110
|
print(f"Use 'fastled {args.directory}' to compile the project.")
|
111
111
|
sys.exit(0)
|
fastled/project_init.py
CHANGED
@@ -9,12 +9,19 @@ ENDPOINT_PROJECT_INIT = f"{DEFAULT_URL}/project/init"
|
|
9
9
|
ENDPOINT_INFO = f"{DEFAULT_URL}/info"
|
10
10
|
DEFAULT_EXAMPLE = "wasm"
|
11
11
|
|
12
|
+
_EXCLUDED_EXAMPLES = [
|
13
|
+
"Pintest",
|
14
|
+
"OctoWS2811",
|
15
|
+
]
|
16
|
+
|
12
17
|
|
13
18
|
def get_examples() -> list[str]:
|
14
19
|
response = httpx.get(ENDPOINT_INFO, timeout=4)
|
15
20
|
response.raise_for_status()
|
16
|
-
|
17
|
-
|
21
|
+
examples: list[str] = response.json()["examples"]
|
22
|
+
# filter out excluded examples
|
23
|
+
examples = [example for example in examples if example not in _EXCLUDED_EXAMPLES]
|
24
|
+
return sorted(examples)
|
18
25
|
|
19
26
|
|
20
27
|
def _prompt_for_example() -> str:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.66
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -33,8 +33,7 @@ Compiles an Arduino/Platformio sketch into a wasm binary that can be run directl
|
|
33
33
|
|
34
34
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
|
35
35
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
|
36
|
-
[](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml)
|
36
|
+
[](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
|
38
37
|
|
39
38
|
|
40
39
|
# About
|
@@ -88,7 +87,7 @@ You can also spawn a server in one process and then access it in another, like t
|
|
88
87
|
```bash
|
89
88
|
fastled --server # server will now run in the background.
|
90
89
|
# now launch the client
|
91
|
-
fastled examples/wasm --local # local will find the local server use it do the compile.
|
90
|
+
fastled examples/wasm --local # local will find the local server and use it to do the compile.
|
92
91
|
```
|
93
92
|
|
94
93
|
After compilation a web browser windows will pop up. Changes to the sketch will automatically trigger a recompilation.
|
@@ -184,7 +183,7 @@ with Api.server() as server:
|
|
184
183
|
|
185
184
|
## Hot reload by default
|
186
185
|
|
187
|
-
Once launched, the compiler will remain open, listening to changes and recompiling as necessary
|
186
|
+
Once launched, the compiler will remain open, listening to changes and recompiling as necessary, hot-reloading the sketch into the current browser.
|
188
187
|
|
189
188
|
This style of development should be familiar to those doing web development.
|
190
189
|
|
@@ -193,19 +192,19 @@ This style of development should be familiar to those doing web development.
|
|
193
192
|
If you launch `fastled` in the FastLED repo then this tool will automatically detect this and map the src directory into the
|
194
193
|
host container. Whenever there are changes in the source code from the mapped directory, then these will be re-compiled
|
195
194
|
on the next change or if you hit the space bar when prompted. Unlike a sketch folder, a re-compile on the FastLED src
|
196
|
-
can be much longer, for example if you modify a header file.
|
195
|
+
can be much longer, for example, if you modify a header file.
|
197
196
|
|
198
197
|
## Big Data in `/data` directory won't be round-tripped
|
199
198
|
|
200
199
|
Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
|
201
200
|
back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
|
202
|
-
will be replaced with a stub containing the size and hash of the file during upload. On download these stubs are swapped back
|
201
|
+
will be replaced with a stub containing the size and hash of the file during upload. On download, these stubs are swapped back
|
203
202
|
with their originals during decompression.
|
204
203
|
|
205
|
-
The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest
|
204
|
+
The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest which can be used
|
206
205
|
in your wasm sketch using an emulated SD card system mounted at `/data/` on the SD Card. In order to increase load speed, these
|
207
|
-
files will be
|
208
|
-
immediately injected in the app before setup() is called and can be used
|
206
|
+
files will be asynchronously streamed into the running sketch instance during runtime. Files named with *.json, *.csv, *.txt will be
|
207
|
+
immediately injected in the app before setup() is called and can be used immediately in setup() in their entirety.
|
209
208
|
|
210
209
|
All other files will be streamed in. The `Video` element in FastLED is designed to gracefully handle missing data streamed in through
|
211
210
|
the file system.
|
@@ -214,30 +213,30 @@ For an example of how to use this see `examples/SdCard` which is fully wasm comp
|
|
214
213
|
|
215
214
|
## Compile Speed
|
216
215
|
|
217
|
-
|
216
|
+
There are three compile settings available to the user. The default is `--quick`. Aggressive optimizations are done with `--release` which will optimize for size, although the speed difference between `--release` and `--quick` seems negligible. But `--release` will produce a ~1/3 smaller binary. There is also `--debug`, which will include symbols necessary for debugging and getting the C++ function symbols working correctly in the browser during step-through debugging. In my personal tests it works better than expected, but don't expect to have gdb or msvc debugger level of the debugging experience.
|
218
217
|
|
219
|
-
We use `ccache` to cache object files. This seems actually help a lot and is better than
|
218
|
+
We use `ccache` to cache object files. This seems actually help a lot and is better than Platformio's method of tracking what needs to be rebuilt. This works as a two-tier cache system. What Platformio misses will be covered by ccache's more advanced file changing system.
|
220
219
|
|
221
|
-
The compilation to wasm will happen under a lock. Removing this lock requires removing the
|
220
|
+
The compilation to wasm will happen under a lock. Removing this lock requires removing the Platformio toolchain as the compiler backend which enforces its own internal lock preventing parallel use.
|
222
221
|
|
223
222
|
## Sketch Cache
|
224
223
|
|
225
|
-
|
226
|
-
printing while the actual source files are sent to compiler to preserve line numbers and file names.
|
224
|
+
Sketches are aggressively fingerprinted and stored in a cache. White space, comments, and other superficial data will be stripped out during pre-processing and minimization for fingerprinting. This source file decimation is only used for finger
|
225
|
+
printing while the actual source files are sent to the compiler to preserve line numbers and file names.
|
227
226
|
|
228
|
-
This pre-processing done is done via gcc and special regex's and will happen without a lock. This will allow you to have extremely quick recompiles for whitespace and changes in comments
|
227
|
+
This pre-processing done is done via gcc and special regex's and will happen without a lock. This will allow you to have extremely quick recompiles for whitespace and changes in comments.
|
229
228
|
|
230
229
|
## Local compiles
|
231
230
|
|
232
|
-
If the web
|
231
|
+
If the web compiler gets congested then it's recommended that you run the compiler locally. This requires docker and will be invoked whenever you pass in `--local`. This will first pull the most recent Docker image of the Fastled compiler, launch a webserver, and then connect to it with the client once it's been up.
|
233
232
|
|
234
233
|
## Auto updates
|
235
234
|
|
236
|
-
In server mode the git repository will be cloned as a side repo and then periodically updated and rsync'd to the src directory. This allows a long
|
235
|
+
In server mode, the git repository will be cloned as a side repo and then periodically updated and rsync'd to the src directory. This allows a long-running instance to stay updated.
|
237
236
|
|
238
|
-
## Compatibility with Arduino
|
237
|
+
## Compatibility with Arduino sketches
|
239
238
|
|
240
|
-
The compatibility is
|
239
|
+
The compatibility is pretty good. Most simple sketches should compile out of the box. Even some of the AVR platforms are stubbed out to make it work. For Arduino, the familiar `digitalWrite()`, `Serial.println()`, and other common functions work. Although `digitalRead()` will always return 0 and `analogRead()` will return random numbers.
|
241
240
|
|
242
241
|
### Faqs
|
243
242
|
|
@@ -245,22 +244,26 @@ Q: How often is the docker image updated?
|
|
245
244
|
A: It's scheduled for rebuild once a day at 3am Pacific time, and also on every change to this repo.
|
246
245
|
|
247
246
|
Q: How can I run my own cloud instance of the FastLED wasm compiler?
|
248
|
-
A: Render.com (which fastled is hosted on) or DigialOcean can accept a
|
247
|
+
A: Render.com (which fastled is hosted on) or DigialOcean can accept a GitHub repo and auto-build the docker image.
|
249
248
|
|
250
249
|
Q: Why does FastLED tend to become choppy when the browser is in the background?
|
251
250
|
A: FastLED Wasm currently runs on the main thread and therefor Chrome will begin throttling the event loop when the browser is not in the foreground. The solution to this is to move FastLED to a web worker where it will get a background thread that Chrome / Firefox won't throttle.
|
252
251
|
|
253
252
|
Q: Why does a long `delay()` cause the browser to freeze and become sluggish?
|
254
|
-
A: `delay()` will block `loop()` which blocks the main thread of the browser. The solution is a webworker which will not affect main thread performance of the browser.
|
253
|
+
A: `delay()` will block `loop()` which blocks the main thread of the browser. The solution is a webworker which will not affect the main thread performance of the browser.
|
255
254
|
|
256
255
|
|
257
256
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
258
|
-
A: A big chunk of space is being used by unnecessary javascript `emscripten`
|
259
|
-
|
257
|
+
A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
|
260
258
|
|
261
259
|
# Revisions
|
262
260
|
|
263
|
-
* 1.1.
|
261
|
+
* 1.1.61 - Excluded non compiling examples from the Test object as part of the api - no sense in having them if they won't compile.
|
262
|
+
* 1.1.60 - Platform executables (macos-arm/macos-x86/windows/linux-x86) now auto building with each release. Add tests.
|
263
|
+
* 1.1.52 - Add linux-arm
|
264
|
+
* 1.1.49 - Try again.
|
265
|
+
* 1.1.46 - Add mac x86 exe
|
266
|
+
* 1.1.45 - Another try for web publishing from github.
|
264
267
|
* 1.1.42 - Second test for web publishing from github.
|
265
268
|
* 1.1.41 - Platform executable (through pyinstaller) now enabled.
|
266
269
|
* 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
|
@@ -1,6 +1,6 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
2
|
-
fastled/app.py,sha256=
|
3
|
-
fastled/cli.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=aL5prnilcRw93zFftSaKU78gvhHbutdCTrMGp8w8kd4,3462
|
2
|
+
fastled/app.py,sha256=AHLQczFKLV1ZyGCh45wTvJqQpQyJ_Ukh3MmG3Om4NHQ,1844
|
3
|
+
fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
|
4
4
|
fastled/client_server.py,sha256=MGE4rg40EA2ty6nKExVxkjUbPbif1Bbx0vDjwNcDOD8,12563
|
5
5
|
fastled/compile_server.py,sha256=Z7rHFs3M6QPbSCsbgHAQDk6GTVAJMMPCXtD4Y0mu8RM,2659
|
6
6
|
fastled/compile_server_impl.py,sha256=ClBLtFHB0ucaT8tAJfI6o3bJ-LRnXc4Pxy7bVKnFiww,8803
|
@@ -9,9 +9,9 @@ fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
|
|
9
9
|
fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
|
10
10
|
fastled/live_client.py,sha256=_KvqmyUyyGpoYET1Z9CdeUVoIbFjIUWwPcTp5XCQuxY,2075
|
11
11
|
fastled/open_browser.py,sha256=vzMBcpDNY0f-Bx9KmEILKDANZ6gvsywCVwn1FRhPXh4,1770
|
12
|
-
fastled/parse_args.py,sha256=
|
12
|
+
fastled/parse_args.py,sha256=zVDFudUO1pKYbC6G1h64O-riCqnNDQsJPTo4YyTIDUM,6238
|
13
13
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
14
|
-
fastled/project_init.py,sha256=
|
14
|
+
fastled/project_init.py,sha256=FH8LtrFwBVijGOzM4UczIdEET7XhXDtf0LkPUMNBVCs,2367
|
15
15
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
16
16
|
fastled/settings.py,sha256=3eMKv0tLXgIQ0CFDboIp_l5_71rzIIyWg353YjnYJnc,323
|
17
17
|
fastled/sketch.py,sha256=483TrrIdZJfo1MIu5FkD-V5OGmOfHmsZ2f6VvNsJBJM,3299
|
@@ -22,9 +22,9 @@ fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
|
22
22
|
fastled/web_compile.py,sha256=05PeLJ77QQC6PUKjDhsntBmyBola6QQIfF2k-zjYNE4,10261
|
23
23
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
24
24
|
fastled/test/examples.py,sha256=EDXb6KastKOOWzew99zrpmcNcXTcAtYi8eud6F1pnWA,980
|
25
|
-
fastled-1.1.
|
26
|
-
fastled-1.1.
|
27
|
-
fastled-1.1.
|
28
|
-
fastled-1.1.
|
29
|
-
fastled-1.1.
|
30
|
-
fastled-1.1.
|
25
|
+
fastled-1.1.66.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
26
|
+
fastled-1.1.66.dist-info/METADATA,sha256=t0Ry3u8OPz5oQwttQxcX2jLGZsGV2R4BviIUeSl4izI,18480
|
27
|
+
fastled-1.1.66.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
28
|
+
fastled-1.1.66.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
29
|
+
fastled-1.1.66.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
30
|
+
fastled-1.1.66.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|