Skip to content

fix: first set pinMode, then write to pin#10520

Merged
thebentern merged 1 commit into
meshtastic:developfrom
kpmy:develop
May 21, 2026
Merged

fix: first set pinMode, then write to pin#10520
thebentern merged 1 commit into
meshtastic:developfrom
kpmy:develop

Conversation

@kpmy

@kpmy kpmy commented May 20, 2026

Copy link
Copy Markdown
Contributor

Simple fix of rarely used functions (EN pin of SX1262 and EN pin of fan), detected on my brand new LilyGo T-Beam 1W.

Before that fix there was a Critical Error 3.

[  5858][E][esp32-hal-gpio.c:181] __digitalWrite(): IO 40 is not set as GPIO. Execute digitalMode(40, OUTPUT) first.
[  5870][E][esp32-hal-gpio.c:181] __digitalWrite(): IO 41 is not set as GPIO. Execute digitalMode(41, OUTPUT) first.

@CLAassistant

CLAassistant commented May 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the bugfix Pull request that fixes bugs label May 20, 2026
@thebentern thebentern requested a review from Copilot May 20, 2026 22:18

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 fixes initialization ordering for two optional GPIO-controlled enable pins so the pin is configured as an output before being driven HIGH, avoiding ESP32 runtime errors like __digitalWrite(): IO xx is not set as GPIO.

Changes:

  • In SX126xInterface::init(), set pinMode(..., OUTPUT) before digitalWrite(..., HIGH) for SX126X_POWER_EN.
  • In SX126xInterface::init(), set pinMode(..., OUTPUT) before digitalWrite(..., HIGH) for RF95_FAN_EN.

@thebentern thebentern merged commit f2c5cb0 into meshtastic:develop May 21, 2026
85 of 86 checks passed
Evil8it pushed a commit to Evil8it/ME4TACTNK that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants