Skip to content

Fix enable_internal_pullup to always use pull-ups#13

Merged
UncleRus merged 1 commit intoesp-idf-lib:mainfrom
cleishm:fix-internal-pullup-direction
Mar 11, 2026
Merged

Fix enable_internal_pullup to always use pull-ups#13
UncleRus merged 1 commit intoesp-idf-lib:mainfrom
cleishm:fix-internal-pullup-direction

Conversation

@cleishm
Copy link
Contributor

@cleishm cleishm commented Mar 10, 2026

Summary

  • Fix enable_internal_pullup to always enable pull-up resistors, as encoder pins need pull-ups since they are wired with common to ground
  • When enable_internal_pullup is false, leave pull resistors unchanged instead of explicitly disabling them, so users can pre-configure pulls via gpio_set_pull_mode() before creating the encoder
  • Add documentation noting that the button pin may need a separate pull-down (external or via gpio_set_pull_mode()) when btn_pressed_level is 1
  • Bump version to 3.0.1

Fixes #12

@cleishm cleishm force-pushed the fix-internal-pullup-direction branch from 7d4653d to 2462b86 Compare March 10, 2026 23:42
@cleishm
Copy link
Contributor Author

cleishm commented Mar 10, 2026

Note that I chose not to try and support any kind of pulldown through the API (even when btn_pressed_level is high). Setting the gpio pull direction outside this library is probably the right thing to do anyway.

@cleishm cleishm force-pushed the fix-internal-pullup-direction branch from 2462b86 to 5f3ad45 Compare March 11, 2026 00:38
Previously, the pull direction was based on btn_pressed_level, which
caused pull-downs to be applied to encoder pins when btn_pressed_level
was 1. Encoder pins always need pull-ups since they are wired with
common to ground. Now always uses pull-ups and documents that the
button pin may need a separate pull-down when btn_pressed_level is 1.

Fixes esp-idf-lib#12
@cleishm cleishm force-pushed the fix-internal-pullup-direction branch from 5f3ad45 to 8c8d7d2 Compare March 11, 2026 00:42
@UncleRus UncleRus merged commit 2ab0a14 into esp-idf-lib:main Mar 11, 2026
57 checks passed
@UncleRus
Copy link
Member

Thank you!

@cleishm cleishm deleted the fix-internal-pullup-direction branch March 13, 2026 11:25
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.

enable_internal_pullup uses wrong pull direction when btn_pressed_level is 1

2 participants