Skip to content

Commit 690da23

Browse files
authored
Merge pull request #70 from adafruit/fix-32u
Fix 32u with Wire end()
2 parents 9b8e3d5 + 44618da commit 690da23

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: bash ci/actions_install.sh
2121

2222
- name: test platforms
23-
run: python3 ci/build_platform.py main_platforms zero
23+
run: python3 ci/build_platform.py main_platforms zero feather32u4
2424

2525
- name: clang
2626
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .

Adafruit_I2CDevice.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ bool Adafruit_I2CDevice::begin(bool addr_detect) {
3939
* @brief De-initialize device, turn off the Wire interface
4040
*/
4141
void Adafruit_I2CDevice::end(void) {
42-
#ifndef ESP8266
43-
// ESP8266 does not implement Wire::end()
42+
// Not all port implement Wire::end(), such as
43+
// - ESP8266
44+
// - AVR core without WIRE_HAS_END
45+
// - ESP32: end() is implemented since 2.0.1 which is latest at the moment.
46+
// Temporarily disable for now to give time for user to update.
47+
#if !(defined(ESP8266) || \
48+
(defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) || \
49+
defined(ARDUINO_ARCH_ESP32))
4450
_wire->end();
45-
#endif
46-
4751
_begun = false;
52+
#endif
4853
}
4954

5055
/*!

0 commit comments

Comments
 (0)