From 511fa111696367772026a6eac8667e1191e1d4b5 Mon Sep 17 00:00:00 2001 From: ainyan03 <205502311+ainyan03@users.noreply.github.com> Date: Fri, 28 Aug 2026 07:39:16 +0000 Subject: [PATCH] Follow the IOExpander_Base pull API of M5Unified 0.2.21 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. --- library.json | 2 +- library.properties | 2 +- src/M5ModuleQRCode.cpp | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/library.json b/library.json index a027b7c..2a4d8f4 100644 --- a/library.json +++ b/library.json @@ -10,7 +10,7 @@ "url": "https://github.com/M5Stack/M5Module-QRCode.git" }, "dependencies": { - "M5Unified": "*", + "M5Unified": ">=0.2.21", "M5GFX": "*" }, "version": "1.0.1", diff --git a/library.properties b/library.properties index 5fbffff..172d6ca 100644 --- a/library.properties +++ b/library.properties @@ -8,4 +8,4 @@ category=Device Control url=https://github.com/m5stack/M5Module-QRCode.git architectures=esp32 includes=M5ModuleQRCode.h -depends=M5Unified +depends=M5Unified (>=0.2.21) diff --git a/src/M5ModuleQRCode.cpp b/src/M5ModuleQRCode.cpp index 30f40e2..9fabfed 100644 --- a/src/M5ModuleQRCode.cpp +++ b/src/M5ModuleQRCode.cpp @@ -64,13 +64,11 @@ bool M5ModuleQRCode::_init_pi4ioe5v6408() _LOG_DEBUG("pi4ioe5v6408 found at 0x%02x\n", _config.pi4ioe5v6408_addr); _pi4ioe5v6408->setDirection(CHANNEL_QRCODE_POWER_EN, true); - _pi4ioe5v6408->setPullMode(CHANNEL_QRCODE_POWER_EN, true); - _pi4ioe5v6408->enablePull(CHANNEL_QRCODE_POWER_EN, true); + _pi4ioe5v6408->setPullMode(CHANNEL_QRCODE_POWER_EN, m5::IOExpander_Base::pull_up); _pi4ioe5v6408->setHighImpedance(CHANNEL_QRCODE_POWER_EN, false); _pi4ioe5v6408->setDirection(CHANNEL_QRCODE_TRIG, true); - _pi4ioe5v6408->setPullMode(CHANNEL_QRCODE_TRIG, true); - _pi4ioe5v6408->enablePull(CHANNEL_QRCODE_TRIG, true); + _pi4ioe5v6408->setPullMode(CHANNEL_QRCODE_TRIG, m5::IOExpander_Base::pull_up); _pi4ioe5v6408->setHighImpedance(CHANNEL_QRCODE_TRIG, false); return true;