Skip to content

Avoid the legacy driver/i2c.h include in M5GFX.cpp - #284

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:i2c_header_eol
Sep 11, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:i2c_header_eol

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

Summary

M5GFX.cpp includes the legacy driver/i2c.h only to get i2c_port_t / I2C_NUM_x.
ESP-IDF 6.x marks that header as EOL and emits a CRITICAL WARNING pragma on every include; it is scheduled for removal in IDF v7.

This change includes driver/i2c_master.h when it is available (IDF 5.2+) and falls back to driver/i2c.h otherwise (IDF 4.4 / Arduino core 2.x), the same pattern already used in platforms/esp32/common.cpp.
No functional change.

Verified

  • ESP-IDF 6.1 (esp32s3): the driver/i2c.h EOL warning from M5GFX.cpp no longer appears, build passes
  • Arduino core 2.0.3 (IDF 4.4, fallback path), Arduino core 3.3.9, ESP-IDF 5.5.1: build passes
  • Fork CI green on this branch

Only i2c_port_t / I2C_NUM_x are needed here. ESP-IDF 6.x marks
driver/i2c.h as EOL and emits a CRITICAL WARNING pragma on every
include; the header is scheduled for removal in v7. Include
driver/i2c_master.h when available (IDF 5.2+), fall back to
driver/i2c.h for IDF 4.4 (Arduino core 2.x). Same pattern as common.cpp.
@lovyan03
lovyan03 merged commit 4cc1c26 into m5stack:develop Sep 11, 2026
27 checks passed
@ainyan03
ainyan03 deleted the i2c_header_eol branch September 11, 2026 06:32
@ainyan03 ainyan03 mentioned this pull request Sep 14, 2026
@lovyan03 lovyan03 mentioned this pull request Sep 14, 2026
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