diff options
Diffstat (limited to 'drivers/oled')
-rw-r--r-- | drivers/oled/oled_driver.c | 10 | ||||
-rw-r--r-- | drivers/oled/oled_driver.h | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c index 977b701783..f1990567f7 100644 --- a/drivers/oled/oled_driver.c +++ b/drivers/oled/oled_driver.c @@ -82,14 +82,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define I2C_CMD 0x00 #define I2C_DATA 0x40 #if defined(__AVR__) -// already defined on ARM -# define I2C_TIMEOUT 100 -# define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) +# define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) #else // defined(__AVR__) -# define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) +# define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) #endif // defined(__AVR__) -#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) -#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, I2C_TIMEOUT) +#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) +#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, OLED_I2C_TIMEOUT) #define HAS_FLAGS(bits, flags) ((bits & flags) == flags) diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h index 5d0184c55d..4e69f8845c 100644 --- a/drivers/oled/oled_driver.h +++ b/drivers/oled/oled_driver.h @@ -150,6 +150,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # endif #endif +#if !defined(OLED_I2C_TIMEOUT) +# define OLED_I2C_TIMEOUT 100 +#endif + // OLED Rotation enum values are flags typedef enum { OLED_ROTATION_0 = 0, |