Skip to content

feat: add ResetAuto mode for automatic reset strategy detection#20

Merged
deadprogram merged 1 commit intotinygo-org:mainfrom
jgangemi:jae/upstream-reset-auto
Apr 11, 2026
Merged

feat: add ResetAuto mode for automatic reset strategy detection#20
deadprogram merged 1 commit intotinygo-org:mainfrom
jgangemi:jae/upstream-reset-auto

Conversation

@jgangemi
Copy link
Copy Markdown
Contributor

@jgangemi jgangemi commented Apr 9, 2026

Summary

  • Add ResetAuto mode that rotates through classic DTR/RTS, USB-JTAG, and no-reset strategies
  • Add ResetMode.String() method for human-readable reset mode names
  • Extend hardReset with USB timing support (longer delays for USB re-enumeration)

Use case

When the USB interface type is unknown (e.g. a tool that works with multiple board types), ResetAuto tries each reset strategy in sequence rather than requiring the user to specify the correct one.

Test plan

  • go test -v ./pkg/espflasher/... — all tests pass
  • TestResetModeString covers all modes including unknown values
  • golangci-lint run ./pkg/espflasher/... — no new issues

- rotate through classic DTR/RTS, USB-JTAG, and no-reset strategies
- add ResetMode.String() method
- extend hardReset with USB timing support
@deadprogram
Copy link
Copy Markdown
Member

Seems like a very good idea @jgangemi thank you for the addition. Now merging.

@deadprogram deadprogram merged commit 3a71cb3 into tinygo-org:main Apr 11, 2026
3 checks passed
@jgangemi jgangemi deleted the jae/upstream-reset-auto branch April 11, 2026 15:10
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