Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
Feat/433 comprehensive teensy deployer#449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -690,6 +690,5 @@ fn sym_type_for_synth(output_section: &str) -> char { | ||
| } | ||
| } | ||
| #[cfg(test)] | ||
| mod tests; | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Teensy deployer | ||
| State machine for `fbuild deploy -e teensyXX` that takes a wedged Windows host | ||
| back to unattended flashing without manual button presses or USB reseats. | ||
| Implements the design from [issue | ||
| #433](https://github.com/FastLED/fbuild/issues/433) (which supersedes #432). The | ||
| old single-file `teensy.rs` shipped only the bare `teensy_loader_cli` invocation | ||
| and inherited every failure mode the issue catalogues. | ||
| ## Module layout | ||
| - **`mod.rs`** — `TeensyDeployer` + `TeensyLoaderParams`; orchestrates the state | ||
| machine below. | ||
| - **`soft_reboot.rs`** — opens the device's CDC ACM port at **baud 134**, the | ||
| Teensyduino USB stack's magic-baud signal to drop into HalfKay. Replaces the | ||
| Windows-only `teensy_loader_cli` reboot which prints | ||
| `Soft reboot is not implemented for Win32`. | ||
| - **`halfkay_probe.rs`** — confirms the CDC port vanished from | ||
| `serialport::available_ports()` (HalfKay proxy: the device left CDC class for | ||
| HID), or waits up to `wait_for_halfkay_timeout_secs` for the user to press the | ||
| program button. | ||
| - **`flash.rs`** — bounded retry loop around `teensy_loader_cli`. Each attempt | ||
| is a fresh subprocess; stops on first success; surfaces per-attempt diagnostic | ||
| on the way to exhaustion. | ||
| - **`port_discovery.rs`** — pre-flash port snapshot + post-flash detection of | ||
| the newly enumerated CDC ACM port. Filled into `DeploymentResult.port` so the | ||
| post-deploy monitor can attach to the right device. | ||
| - **`first_byte_probe.rs`** — advisory probe that opens the post-flash port and | ||
| reports whether any byte arrived inside `first_byte_timeout_secs`. Silent | ||
| firmware is surfaced as a structured diagnostic, not a deploy failure. | ||
| - **`usb_type.rs`** — best-effort read of `usb_type` from the build artifact | ||
| directory; advises the monitor when the device was built without a Serial | ||
| endpoint (`USB_MIDI_SERIAL`, `USB_RAWHID`). | ||
| ## State machine | ||
| ``` | ||
| pre-snapshot → (CDC at port? → baud-134 trigger) → wait-for-HalfKay | ||
| → flash with retry → wait-for-new-CDC → first-byte probe | ||
| → DeploymentResult { port: Some(new_port), … } | ||
| ``` | ||
| Failure at any stage returns a `DeploymentResult { success: false, message: | ||
| <stage-specific>, stderr: <last loader output> }` — same envelope the daemon | ||
| already propagates to the CLI verbatim. | ||
| ## Env escape hatches | ||
| - `FBUILD_TEENSY_FLASH_RETRIES` — override `flash_retries` (default 5). | ||
| - `FBUILD_TEENSY_FIRST_BYTE_TIMEOUT_SECS` — override | ||
| `first_byte_timeout_secs` (default 10, `0` disables). | ||
| - `FBUILD_TEENSY_DISABLE_BAUD_134_TRIGGER` — opt out of the baud-134 trigger | ||
| (debug aid for the few hosts where `SerialPortBuilder::baud_rate(134)` is not | ||
| honored). | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix markdownlint violations in link wrapping and code fence language.
Line 7 breaks the issue link such that
#433is parsed like a heading token, and the state-machine fence at Line 38 should declare a language for MD040 compliance.Suggested doc-only patch
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
@crates/fbuild-deploy/src/teensy/README.mdaround lines 6 - 7, The markdownlink to issue
#433is being broken so that “#433” is parsed as a heading:replace the broken link text with a proper inline URL (for example wrap the full
issue URL in angle brackets like #433
or remove the stray line break) so the issue number is not treated as a heading,
and add a language identifier to the fenced code block that contains the
pre-snapshot diagram (replace the opening
fence withtext) to satisfyMD040; update the README.md occurrences around the issue link and the fenced
block (the link referencing issue
#433and the fenced block beginning with the“pre-snapshot → …” diagram) accordingly.