Skip to content

Follow the IOExpander_Base pull API of M5Unified 0.2.21 - #3

Merged
Forairaaaaa merged 1 commit into
m5stack:mainfrom
ainyan03:ioexpander_m5unified_0_2_21
Aug 31, 2026
Merged

Follow the IOExpander_Base pull API of M5Unified 0.2.21#3
Forairaaaaa merged 1 commit into
m5stack:mainfrom
ainyan03:ioexpander_m5unified_0_2_21

Conversation

@ainyan03

@ainyan03 ainyan03 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Problem

M5Unified 0.2.21 changed the IOExpander_Base pull API: setPullMode(pin, bool) and enablePull(pin, bool) were replaced by setPullMode(pin, gpio_pull_t). M5Module-QRCode 1.0.1 calls the old form on its PI4IOE5V6408_Class, so it no longer compiles against the current M5Unified release:

src/M5ModuleQRCode.cpp:67:57: error: cannot convert 'bool' to 'm5::IOExpander_Base::gpio_pull_t'
src/M5ModuleQRCode.cpp:68:20: error: 'class m5::PI4IOE5V6408_Class' has no member named 'enablePull'
...

(Same class of problem as m5stack/StackChan-BSP#12 for StackChan-BSP.)

Change

  • Call the new API directly: setPullMode(pin, true) + enablePull(pin, true)setPullMode(pin, pull_up). The register writes are identical: both forms set the PI4IOE5V6408 pull-select bit (0x0D) and then the pull-enable bit (0x0B).
  • Declare the requirement in the library metadata: depends=M5Unified (>=0.2.21) in library.properties and "M5Unified": ">=0.2.21" in library.json, so the Library Manager and PlatformIO install a matching M5Unified instead of failing at compile time.

Verification

Compiled a sketch including M5ModuleQRCode.h with PlatformIO (pioarduino 55.03.34, m5stack-cores3, Arduino) against M5Unified 0.2.21 (develop) + M5GFX 0.2.28: fails on the unmodified library with the errors above, builds with this change. clang-format --dry-run reports no differences.

M5Unified 0.2.21 replaced IOExpander_Base::setPullMode(pin, bool) and
enablePull(pin, bool) with setPullMode(pin, gpio_pull_t), so the library no
longer compiled against it.

Call the new form (setPullMode(pin, pull_up), which writes the same two
register bits as the old pair) and require M5Unified >= 0.2.21 in
library.properties / library.json so the dependency is resolved by the
Library Manager and PlatformIO.
@ainyan03
ainyan03 force-pushed the ioexpander_m5unified_0_2_21 branch from faea95b to 511fa11 Compare August 28, 2026 07:39
@Forairaaaaa
Forairaaaaa merged commit 95f4414 into m5stack:main Aug 31, 2026
1 of 2 checks passed
@Forairaaaaa

Copy link
Copy Markdown
Collaborator

Thanks!

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