From 45e3b31729fecff53227545c1526cf52d26ccc56 Mon Sep 17 00:00:00 2001 From: pi-r-p Date: Thu, 5 Nov 2020 18:17:32 +0100 Subject: [PATCH 1/2] allow users to tweak the I2C timeout --- libraries/Wire/src/utility/twi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index dbf6b99bc8..35e84b6ec5 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -45,7 +45,9 @@ extern "C" { /* Private Defines */ /// @brief I2C timout in tick unit -#define I2C_TIMEOUT_TICK 100 +#if !defined(I2C_TIMEOUT_TICK) + #define I2C_TIMEOUT_TICK 100 +#endif #define SLAVE_MODE_TRANSMIT 0 #define SLAVE_MODE_RECEIVE 1 From e9c62d964cf277e6c522d681962bed06cfb8dff3 Mon Sep 17 00:00:00 2001 From: pi-r-p Date: Fri, 6 Nov 2020 10:05:53 +0100 Subject: [PATCH 2/2] fix style --- libraries/Wire/src/utility/twi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index 35e84b6ec5..f23bab8447 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -45,8 +45,8 @@ extern "C" { /* Private Defines */ /// @brief I2C timout in tick unit -#if !defined(I2C_TIMEOUT_TICK) - #define I2C_TIMEOUT_TICK 100 +#ifndef I2C_TIMEOUT_TICK +#define I2C_TIMEOUT_TICK 100 #endif #define SLAVE_MODE_TRANSMIT 0