Skip to content

Use digitalWrite instead of pinMode - #388

Merged
DocMoebiuz merged 7 commits into
mainfrom
381/fix-tm1637-timings
Jul 27, 2026
Merged

DocMoebiuz merged 7 commits into
mainfrom
381/fix-tm1637-timings

Conversation

@DocMoebiuz

@DocMoebiuz DocMoebiuz commented Jul 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description of changes

We changed the TM1637 data exchange protocol from Open drain to Push-Pull. This allows for faster update times while maintaining compatibility to all TM1637 modules on the market, including those that have a very large cap values on the data lines and deviates from the datasheet recommendations.

part of #381

Copilot AI review requested due to automatic review settings July 26, 2026 20:07

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

This PR refactors the TM1637 (segment display) bit-banging implementation in LedControl_dual to use digitalWrite() for clock/data transitions instead of repeatedly switching pin modes, and updates the bus idle behavior.

Changes:

  • Configure TM1637 CLK/DIO as OUTPUT and idle them HIGH during begin().
  • Update TM1637 start()/stop() to drive levels with digitalWrite() rather than pinMode() transitions.
  • Rewrite the TM1637 byte write loop to clock bits using digitalWrite() and adjust ACK handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/MF_Segment/LedControl_dual.cpp Outdated
Comment thread src/MF_Segment/LedControl_dual.cpp
@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@github-actions

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

@elral elral left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK

@DocMoebiuz
DocMoebiuz merged commit 3d20622 into main Jul 27, 2026
1 check passed
@DocMoebiuz
DocMoebiuz deleted the 381/fix-tm1637-timings branch July 27, 2026 09:10
@DocMoebiuz DocMoebiuz added the bug Something isn't working label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants