From 31620162d78a8310110ecb228087a9830c72f3af Mon Sep 17 00:00:00 2001 From: UncleRus Date: Sun, 13 Dec 2020 14:25:47 +0500 Subject: [PATCH] i2cdev: Fix #139 (clock stertching on esp32s) --- components/i2cdev/i2cdev.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/i2cdev/i2cdev.h b/components/i2cdev/i2cdev.h index fd0810a2..ad76a1fc 100644 --- a/components/i2cdev/i2cdev.h +++ b/components/i2cdev/i2cdev.h @@ -22,10 +22,15 @@ extern "C" { #endif -#if HELPER_TARGET_IS_ESP32 -#define I2CDEV_MAX_STRETCH_TIME 0x00ffffff -#elif HELPER_TARGET_IS_ESP8266 +#if HELPER_TARGET_IS_ESP8266 #define I2CDEV_MAX_STRETCH_TIME 0xffffffff +#else +#include +#ifdef I2C_TIME_OUT_REG_V +#define I2CDEV_MAX_STRETCH_TIME I2C_TIME_OUT_REG_V +#else +#define I2CDEV_MAX_STRETCH_TIME 0x00ffffff +#endif #endif /**