Repository navigation
Conversation
|
@kriegsman at your request the new behaviour is only activated if FASTLED_ALLOW_INTERRUPTS is set to 1. |
For many WS2811 strips, we can relax the clearing of interrupts down to protecting the timing of the shortest pulse. Your interrupts must still be very very fast in order for the strip not to latch part-way through.
2094bd9 to
65da7cc
Compare
|
I'll add a bit more detail / background here. Even with this PR, the default platform behaviour for AVR Clockless remains unchanged (because To make use of this at all, you must The caveats are various. In principal, you are sacrificing specification conformance. In practice, different makes, models or manufacturers of LEDs may have different tolerances to the out-of-spec behaviour, although I have not so far met a strip on which this hasn't worked. The principle being applied, inspired by this blog post, is that there are only 2 timings which matter for ws2812, even though 5 are defined in the spec. The rationale for why the other timings in the spec are irrelevant is discussed in detail in the blog post, and if you study it for a while it becomes increasingly hard to imagine that there would be any pixel models which would obey any other timing directly; it would seem more costly and unnecessarily complicated. The two timings in question constrain the maximum width of a HIGH control pulse that will still be interpreted as a
Which sort of corruptions you may see depends mainly on the frequency of your long interrupts, and your target frame rate, although there are some interesting variations. If your long interrupts are infrequent and your frame rate high, you may see the occasional bright flash across the picture, starting at 0 but going up some random amount. If the frame rate is too low, those flickers may stay displayed for a long time. The "flicker" is actually a partially corrupted frame with random colours on some proportion of the lowest pixels. This is because if a latch event happens partway through a byte, the remaining bits from the frame will effectively start a new frame on the strip at pixel 0, and 7/8ths of the time the color bits will be offset with bits from adjacent colors leading to corruption that's very bright and obnoxious unless all your LEDs are set to black. Alternatively, if the interrupt rate is so high that it interrupts every frame, perhaps more than once, then you may end up with a "cutoff" pixel beyond which your picture can never seem to reach. The higher the interrupt frequency, the closer to 0 that cutoff will get - and so all the pixels will be colour gibberish all the time. Nevertheless, there are some things you can control. One thing to consider is that your interrupt may be short enough if it fires alone, but may be too long if it fires simultaneously with another interrupt. This is especially relevant for timer interrupts, remembering that the the Arduino Core clock timer is a thing. It's often possible to refactor ISRs to just buffer work for when back in the main loop (e.g. " I have no idea if other popular Arduino libraries have ISRs which are too long and run at a high frequency. I have not tried the "servo" library that seems to come up in support requests a lot. |
|
Any feedback which would get this merged? |
fbuild 2.5.15 was published to PyPI on 2026-08-07 05:34:16Z (tag v2.5.15). It carries three fixes this repo needs, all confirmed ancestors of the tag: 2976d863 fix(rp): honor Arduino Bluetooth menu (#1263) 0dd68b24 fix(teensy): run the link in the build dir (#1268) 1324d6c6 fix(arm): run the link in the build dir for every ARM linker (#1270) Why it matters here: - #1263 is what makes `board_build.ipbtstack = ipv4btcble` take effect, so `libipv4-bt.a` is linked instead of `libipv4.a` and BTstackLib compiles. Without it the rp2350w build dies at `_needsbt.h`'s `static_assert(ENABLE_CLASSIC, ...)`, which blocked every RP2350W HIL flow in #3864. - #1268/#1270 stop the ARM link running in the daemon's inherited cwd, which was dropping a stray 0-byte `-r` file into the repo root on every clean build (#3867). Verified against the published wheel (registry install, not a local build — the previously reported rp2350w validation used a local fbuild development executable and was not reproducible from a clean checkout): bash compile rp2350w --examples AutoResearch -> build succeeded in 253.7s (flash: 1177936 bytes, ram: 132048 bytes) -> SUCCESS: AutoResearch -> working tree clean, no stray `-r` Byte-identical to the local-build result, so the published artifact behaves the same. `bash lint` clean. C++ tests fingerprint-skipped (no C++ changed in this commit); the cached result is 362/362. Refs #3864, #3867, FastLED/fbuild#1269 Co-authored-by: Claude <[email protected]>
For many WS2811 strips, we can relax the clearing of interrupts down to protecting the timing of the shortest pulse. Your interrupts must still be very very fast in order for the strip not to latch part-way through.