Skip to content

Delay TFUc for 2*reset for more reliability - #137

Merged
asasine merged 2 commits into
OpenDevicePartnership:stable-v0.1.yfrom
asasine:longer-tfuc-reset-delay
Sep 15, 2026
Merged

asasine merged 2 commits into
OpenDevicePartnership:stable-v0.1.yfrom
asasine:longer-tfuc-reset-delay

Conversation

@asasine

@asasine asasine commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

TFUc has been shown to take up to 2s from when it's sent on the bus to when the device is first seen in an app mode. The previous timeout of 1.6s was not always sufficient for this, so I went ahead and doubled the delay to a safe 3.2s. The timeout remains +500ms.

@asasine
asasine requested a review from a team as a code owner September 14, 2026 23:09
@asasine
asasine requested review from gjpmsft and tullom and a lite review from Copilot September 14, 2026 23:09
@asasine asasine changed the title Delay for 2*reset for more reliability Delay TFUc for 2*reset for more reliability Sep 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test currently fails, and the timeout behavior does not match the stated 3.2-second design.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR increases TFUc timing allowances to improve reliability when devices take longer to enter app mode.

Changes:

  • Doubles the post-command reset wait.
  • Extends the TFUc timeout budget.
File summaries
File Findings
src/command/mod.rs Critical (3 votes): Existing test expectation causes cargo test to fail. Moderate (1 vote): The calculation produces a 3.7s timeout, not the stated 3.2s.
src/asynchronous/internal/command.rs Moderate (2 votes): An unconditional 3.2s sleep prevents successful completion around 2s; mode verification should allow earlier success.
Review details

Suppressed comments (1)

src/command/mod.rs:214

  • With RESET_DELAY_MS == 1600 and TFUC_VERIFICATION_SLACK_MS == 500, this expression sets the timeout to 3700 ms, not the 3.2 seconds stated in the PR description. If 3.2 seconds is the intended cap, do not add the existing slack on top of the doubled delay; otherwise update the description and test to document the actual 3.7-second timeout.
            Command::Tfuc => 2 * RESET_DELAY_MS + TFUC_VERIFICATION_SLACK_MS,
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/command/mod.rs
Comment thread src/asynchronous/internal/command.rs
@asasine
asasine enabled auto-merge (squash) September 14, 2026 23:38
@asasine
asasine merged commit 7471493 into OpenDevicePartnership:stable-v0.1.y Sep 15, 2026
13 checks passed
@asasine
asasine deleted the longer-tfuc-reset-delay branch September 15, 2026 16:54
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.

4 participants