From 7b97d0de31fadee7459f4250963da4ec7054e263 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Nov 2021 10:01:51 +0700 Subject: [PATCH 1/4] add feather32u4 to ci build --- .github/workflows/githubci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml index b1d3fa0..d0e3229 100644 --- a/.github/workflows/githubci.yml +++ b/.github/workflows/githubci.yml @@ -20,7 +20,7 @@ jobs: run: bash ci/actions_install.sh - name: test platforms - run: python3 ci/build_platform.py main_platforms zero + run: python3 ci/build_platform.py main_platforms zero feather32u4 - name: clang run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . From 8b26deb581464a26e5583e26490d57e7632e204c Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Nov 2021 11:37:29 +0700 Subject: [PATCH 2/4] fix 32u4 which is avr core without WIRE_HAS_END --- Adafruit_I2CDevice.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index bbe869c..b109f9d 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -39,12 +39,13 @@ bool Adafruit_I2CDevice::begin(bool addr_detect) { * @brief De-initialize device, turn off the Wire interface */ void Adafruit_I2CDevice::end(void) { -#ifndef ESP8266 - // ESP8266 does not implement Wire::end() + // Not all port implement Wire::end(), such as + // - ESP8266 + // - AVR core without WIRE_HAS_END +#if ! ( defined(ESP8266) || (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) ) _wire->end(); -#endif - _begun = false; +#endif } /*! From 389f4cd417733c8fe5b9fd4cb44d9b20bad91705 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Nov 2021 12:44:53 +0700 Subject: [PATCH 3/4] clang --- Adafruit_I2CDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index b109f9d..6c2adea 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -42,7 +42,7 @@ void Adafruit_I2CDevice::end(void) { // Not all port implement Wire::end(), such as // - ESP8266 // - AVR core without WIRE_HAS_END -#if ! ( defined(ESP8266) || (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) ) +#if !(defined(ESP8266) || (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END))) _wire->end(); _begun = false; #endif From 44618da5a6e2f5255146679e13f44254329ee11d Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Nov 2021 13:28:12 +0700 Subject: [PATCH 4/4] temporarily skip end() for esp32 arch --- Adafruit_I2CDevice.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index 6c2adea..716fe1e 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -42,7 +42,11 @@ void Adafruit_I2CDevice::end(void) { // Not all port implement Wire::end(), such as // - ESP8266 // - AVR core without WIRE_HAS_END -#if !(defined(ESP8266) || (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END))) + // - ESP32: end() is implemented since 2.0.1 which is latest at the moment. + // Temporarily disable for now to give time for user to update. +#if !(defined(ESP8266) || \ + (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) || \ + defined(ARDUINO_ARCH_ESP32)) _wire->end(); _begun = false; #endif