Merge pull request #70 from adafruit/fix-32u

Fix 32u with Wire end()
This commit is contained in:
Ha Thach 2021-11-26 13:53:59 +07:00 committed by GitHub
commit 690da23a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -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 .

View File

@ -39,12 +39,17 @@ 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
// - 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();
#endif
_begun = false;
#endif
}
/*!