feat(wifi): retry association with backoff in shared connect helper

The single-shot connect_wifi aborted boot on any transient association or
DHCP miss — common right after a reset, when the AP still holds the stale
pre-reset association. Add a bounded retry (5 attempts, 500ms→4s backoff,
disconnect between tries) so those transient failures recover instead of
failing the boot.

Extract the logic into firmware::net (new lib target) and rewire the
wifi_tls / git_push / git_sync spikes to it, removing three duplicated
copies. main.rs reuses this when Wi-Fi lands there instead of adding a
fourth copy.
This commit is contained in:
Julien Calixte
2026-07-10 23:44:02 +02:00
parent 4460475fb0
commit 875658a661
6 changed files with 104 additions and 75 deletions

10
firmware/src/lib.rs Normal file
View File

@@ -0,0 +1,10 @@
//! Shared library surface for the Typoena firmware crate.
//!
//! The editor binary (`src/main.rs`) and the spike binaries under `src/bin/`
//! are each separate crate roots; anything they need to share lives here and is
//! reached as `firmware::…`. Currently that is just the resilient Wi-Fi
//! bring-up, extracted from three duplicated `connect_wifi` copies so the retry
//! logic lives in exactly one place and the eventual editor integration reuses
//! it instead of growing a fourth copy.
pub mod net;