Skip to content

fix(heltec_t114): correct swapped P0.X comments on Wire1 I2C pins#2760

Open
tahnok wants to merge 1 commit into
meshcore-dev:mainfrom
tahnok:fix/t114-i2c-pin-comments
Open

fix(heltec_t114): correct swapped P0.X comments on Wire1 I2C pins#2760
tahnok wants to merge 1 commit into
meshcore-dev:mainfrom
tahnok:fix/t114-i2c-pin-comments

Conversation

@tahnok

@tahnok tahnok commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

What

Corrects the // P0.X comments on the T114 Wire1 I2C pins in variants/heltec_t114/variant.h. They were swapped and wrong:

// before
#define PIN_WIRE1_SDA  (7) // P0.8
#define PIN_WIRE1_SCL  (8) // P0.7
// after
#define PIN_WIRE1_SDA  (7) // P0.07
#define PIN_WIRE1_SCL  (8) // P0.08

Per g_ADigitalPinMap in variant.cpp (1:1 for pins ≥ 2), Arduino pin 7 = P0.07 and pin 8 = P0.08. The old comments labelled pin 7 as P0.8 and pin 8 as P0.7 — both wrong, and swapped relative to each other.

Why it matters

Wire1 is the environment-sensor bus (ENV_PIN_SDA/ENV_PIN_SCL in the T114 platformio.ini). The misleading comments lead users to wire INA219 / other I2C sensors with SDA and SCL reversed. A reversed bus means the sensor never ACKs, and on the nRF52 TWIM a stuck/miswired bus can block inside the I2C scan in EnvironmentSensorManager::begin(), which runs in setup() before the USB CLI is serviced — so the device appears to "lock up" / stop responding to USB configuration whenever the sensor is plugged in.

The wrong comments date back to the sensor-management refactor (commit 5cb26b91) and have never been corrected.

Scope

Comment-only change. No electrical or behavioral change to the firmware.

🤖 Generated with Claude Code

The PIN_WIRE1_SDA/SCL comments were swapped and wrong: pin 7 was
labelled P0.8 and pin 8 labelled P0.7. Per g_ADigitalPinMap (1:1 for
pins >= 2), Arduino pin 7 = P0.07 and pin 8 = P0.08. Wire1 is the
environment-sensor bus (ENV_PIN_SDA/SCL), so the misleading comments
can lead users to wire INA219/other sensors with SDA/SCL reversed,
which prevents the sensor from responding and can hang the I2C scan in
EnvironmentSensorManager::begin() at boot.

Comment-only change; no electrical/behavioral change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant