Add the LICENSE file, declare the license in Cargo.toml, and say so in the
README. The Zigbee stack in vendor/zigbee-rs is a separate project and keeps
its own licenses (MIT or Apache-2.0).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Split the single app partition into two slots, ota_0 and ota_1, with an
otadata partition that tells the bootloader which to run, so an update can
be written to the idle slot while the other keeps running. The Zigbee
storage partition is unchanged, so the light keeps its network. Moving from
the old table needs one USB flash.
* src/ota.rs logs the running slot and the state of its image at boot,
marks an image valid after it has stayed up for 20 seconds, and can
switch to the other slot and restart. The slot in use is read from the
flash mapping, not from otadata.
* src/flash.rs shares the one flash handle: esp-storage allows only one, and
both the Zigbee stack and the update code need it.
* The runner clears otadata on every USB flash. A USB flash always writes
slot 0, so without this a board that had switched to slot 1 would keep
booting the old image.
* Two development features, ota-test and ota-test-crash, exercise slot
switching and an unconfirmed image without an update source. FW_LABEL tells
builds apart in the log.
Tested on the hardware: switching between two images across six reboots, each
booting the slot it had just selected, resuming its Zigbee network, and
confirming itself. Rollback is not available: the bootloader espflash installs
is not built with it, so a newly selected image reports "New" rather than
"PendingVerify", and an image that resets without confirming itself is booted
again indefinitely. Needs a rollback-enabled bootloader. Nothing delivers
updates yet. Both are recorded in TODO.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Waiting on both phases via select drops the pending future each time the
other fires, so B's edges were being lost and a later sample of B always
read it back at rest. Triggering on B's falling edge and sampling A there
is stable on this encoder.
Also moves the encoder to D10/D9/D8 next to the power pads, drops the
strip to a single LED for bring-up, and makes saturation an adjustable
axis so the light defaults to white.
Moves the whole esp stack to esp-hal 1.2 (see the zigbee-rs submodule),
which lets esp-hal-smartled 0.18 be used unmodified from crates.io
instead of a hand-rolled RMT driver.
Replaces the hand-rolled Rgb type, HSV conversion and brightness scaling
with RGB8, hsv2rgb, gamma and brightness from smart-leds, and exposes the
driver as SmartLedsWriteAsync. The RMT symbol encoding stays in-tree: no
upstream RMT driver currently targets esp-hal 1.1.