add a global define that can displabe Wire.setClock()

This commit is contained in:
Peter Bendel
2022-04-29 17:03:10 +02:00
parent 7014e1d9a6
commit d51d9a4897
2 changed files with 23 additions and 3 deletions
+9 -3
View File
@@ -1341,8 +1341,11 @@ extern "C" uint8_t u8x8_byte_arduino_hw_i2c(U8X8_UNUSED u8x8_t *u8x8, U8X8_UNUSE
case U8X8_MSG_BYTE_START_TRANSFER:
#if ARDUINO >= 10600
/* not sure when the setClock function was introduced, but it is there since 1.6.0 */
/* if there is any error with Wire.setClock() just remove this function call */
Wire.setClock(u8x8->bus_clock);
/* if there is any error with Wire.setClock() just remove this function call by */
/* defining U8x8_DO_NOT_SET_WIRE_CLOCK */
#ifndef U8x8_DO_NOT_SET_WIRE_CLOCK
Wire.setClock(u8x8->bus_clock);
#endif
#endif
Wire.beginTransmission(u8x8_GetI2CAddress(u8x8)>>1);
break;
@@ -1374,8 +1377,11 @@ extern "C" uint8_t u8x8_byte_arduino_2nd_hw_i2c(U8X8_UNUSED u8x8_t *u8x8, U8X8_U
case U8X8_MSG_BYTE_START_TRANSFER:
#if ARDUINO >= 10600
/* not sure when the setClock function was introduced, but it is there since 1.6.0 */
/* if there is any error with Wire.setClock() just remove this function call */
/* if there is any error with Wire.setClock() just remove this function call by */
/* defining U8x8_DO_NOT_SET_WIRE_CLOCK */
#ifndef U8x8_DO_NOT_SET_WIRE_CLOCK
Wire1.setClock(u8x8->bus_clock);
#endif
#endif
Wire1.beginTransmission(u8x8_GetI2CAddress(u8x8)>>1);
break;