Skip to content

fix(lora): make async init recoverable and thread-safe - #152

Merged
dianjixz merged 1 commit into
CardputerZero:masterfrom
Forairaaaaa:fix/lora-init-retry-lifecycle
Aug 20, 2026
Merged

fix(lora): make async init recoverable and thread-safe#152
dianjixz merged 1 commit into
CardputerZero:masterfrom
Forairaaaaa:fix/lora-init-retry-lifecycle

Conversation

@Forairaaaaa

Copy link
Copy Markdown
Collaborator

The async-init rework used a detached thread plus a one-shot, no-retry path. A transient cold-boot / EXT5V failure would wedge the page as "LoRa unavailable" with no recovery, and re-entering the page could run two init threads against the global backend state at once.

  • Keep the init thread joinable and join it in the destructor and before each new attempt, so the global hardware state is never touched by two init threads concurrently.
  • Retry failed initialization with a 3s backoff instead of giving up.
  • Split the misleading "LoRa is still initializing" send status into a distinct "LoRa unavailable" message.

The async-init rework used a detached thread plus a one-shot, no-retry
path. A transient cold-boot / EXT5V failure would wedge the page as
"LoRa unavailable" with no recovery, and re-entering the page could run
two init threads against the global backend state at once.

- Keep the init thread joinable and join it in the destructor and before
  each new attempt, so the global hardware state is never touched by two
  init threads concurrently.
- Retry failed initialization with a 3s backoff instead of giving up.
- Split the misleading "LoRa is still initializing" send status into a
  distinct "LoRa unavailable" message.
@dianjixz
dianjixz merged commit cc873d3 into CardputerZero:master Aug 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants