Skip to content

Disable DTR for megas in general, enable it for only the one that requires it.#2968

Draft
tigert wants to merge 4 commits into
MobiFlight:mainfrom
tigert:dtr-mega-fix-round2
Draft

Disable DTR for megas in general, enable it for only the one that requires it.#2968
tigert wants to merge 4 commits into
MobiFlight:mainfrom
tigert:dtr-mega-fix-round2

Conversation

@tigert

@tigert tigert commented May 17, 2026

Copy link
Copy Markdown
Contributor

Enabling DTR for all boards breaks ESP32 based custom device projects currently. The reason DTR is enabled, is because one variant of Arduino Mega needs it. Most megas and also esp32 use CH340 that share the same VID & PID, but luckily the affected Arduino Mega variant uses different ID's.

  • Disable DTR for all Mega boards
  • Enable DTR specifically for the Mega wth Atmega16U2 that needs it

…e projects currently. The reason DTR is enabled, is because one variant of Arduino Mega needs it.

- Disable DTR for all Mega boards
- Enable DTR specifically for the Mega wth Atmega16U2 that needs it
Copilot AI review requested due to automatic review settings May 17, 2026 15:26
@tigert tigert requested a review from DocMoebiuz as a code owner May 17, 2026 15:26
@tigert tigert marked this pull request as draft May 17, 2026 15:26
@tigert

tigert commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

marked this as draft so we can give it some testing first.

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.

Pull request overview

Splits the Arduino Mega board definition so that only the Atmega16U2-based Mega variant (VID_2341&PID_0042) keeps DtrEnable: true, while all other Mega boards (sharing CH340 chips with ESP32) have DTR disabled to avoid breaking ESP32-based custom device projects.

Changes:

  • Set DtrEnable to false in arduino_mega.board.json and remove the ^VID_2341&PID_0042 hardware ID from its list.
  • Add a new arduino_mega_dtrenable.board.json board definition targeting only ^VID_2341&PID_0042 with DtrEnable: true.
  • Register the new board JSON in the csproj so it is copied to the output directory.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/MobiFlightConnector/Boards/arduino_mega.board.json Disables DTR and removes the Atmega16U2 Mega VID/PID from the generic Mega definition.
src/MobiFlightConnector/Boards/arduino_mega_dtrenable.board.json New board file isolating the Atmega16U2 Mega variant with DTR enabled.
src/MobiFlightConnector/MobiFlightConnector.csproj Includes the new board JSON as content with PreserveNewest.

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

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