diff options
author | Joel Challis <git@zvecr.com> | 2020-07-25 22:50:56 +0100 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2020-08-08 22:52:26 -0700 |
commit | cd0523e7d4b6d6252762cf834d7e7ded88f20da5 (patch) | |
tree | 90d5e6b0f49335f142cf3002234bd80bf4d7a051 /drivers/oled/oled_driver.c | |
parent | 215fdc39fdf465f51844dbda25c9b1f3b41486b7 (diff) |
Enable OLED support for Teensy 3.2/LC (#7591)
* I2C_TIMEOUT is not defined on arm teensy
* Work round teensy having different ChibiOS config options
* Stash OLED conf files
* update comment
* update comment
* Remove stm32 alias to allow teensy alt mode
format code according to conventions [skip ci]
Diffstat (limited to 'drivers/oled/oled_driver.c')
-rw-r--r-- | drivers/oled/oled_driver.c | 10 |
1 files changed, 4 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) |