diff --git a/library.json b/library.json index 8c51e55..5419d6f 100644 --- a/library.json +++ b/library.json @@ -10,7 +10,7 @@ "url": "https://github.com/M5Stack/M5StamPLC.git" }, "dependencies": { - "M5Unified": "*", + "M5Unified": ">=0.2.21", "M5GFX": "*" }, "version": "1.2.0", diff --git a/library.properties b/library.properties index 87c2f0f..f0754ff 100644 --- a/library.properties +++ b/library.properties @@ -8,4 +8,4 @@ category=Device Control url=https://github.com/m5stack/M5StamPLC.git architectures=esp32 includes=src,src/utils -depends=M5Unified \ No newline at end of file +depends=M5Unified (>=0.2.21) \ No newline at end of file diff --git a/src/M5StamPLC.cpp b/src/M5StamPLC.cpp index b8a76c7..ef937e5 100644 --- a/src/M5StamPLC.cpp +++ b/src/M5StamPLC.cpp @@ -61,15 +61,15 @@ void M5_STAMPLC::io_expander_a_init() // Status light init ioe.setDirection(4, true); - ioe.setPullMode(4, false); + ioe.setPullMode(4, m5::IOExpander_Base::pull_down); ioe.setHighImpedance(4, true); ioe.setDirection(5, true); - ioe.setPullMode(5, false); + ioe.setPullMode(5, m5::IOExpander_Base::pull_down); ioe.setHighImpedance(5, true); ioe.setDirection(6, true); - ioe.setPullMode(6, false); + ioe.setPullMode(6, m5::IOExpander_Base::pull_down); ioe.setHighImpedance(6, true); ioe.resetIrq(); diff --git a/src/modules/M5StamPLC_AC.cpp b/src/modules/M5StamPLC_AC.cpp index 2d70426..af20e81 100644 --- a/src/modules/M5StamPLC_AC.cpp +++ b/src/modules/M5StamPLC_AC.cpp @@ -32,13 +32,13 @@ bool M5StamPLC_AC::begin() // AC relay _ioe->setDirection(_pin_relay, true); - _ioe->setPullMode(_pin_relay, false); + _ioe->setPullMode(_pin_relay, m5::IOExpander_Base::pull_down); _ioe->setHighImpedance(_pin_relay, false); // Status light auto setup_status_light_pin = [](m5::PI4IOE5V6408_Class* ioe, uint8_t pin) { ioe->setDirection(pin, true); - ioe->setPullMode(pin, true); + ioe->setPullMode(pin, m5::IOExpander_Base::pull_up); ioe->setHighImpedance(pin, false); ioe->digitalWrite(pin, true); };