diff options
| author | David Hoelscher <infinityis@users.noreply.github.com> | 2024-01-17 07:05:38 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-17 14:05:38 +0100 |
| commit | e9bd7d7ad308f9c72c86863bf9f19382c7e2d892 (patch) | |
| tree | c46ce87aaa57b8f49dc0a2b56527f0bc606038ab /drivers/oled | |
| parent | 2b0965944d9065daa65cd25540cf2dd007f23eda (diff) | |
I2C driver cleanup (#21273)
* remove i2c_start and i2c_stop from i2c drivers
* remove static i2c_address variable from chibios i2c driver
Diffstat (limited to 'drivers/oled')
| -rw-r--r-- | drivers/oled/oled_driver.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c index c674675d11..8cca41394f 100644 --- a/drivers/oled/oled_driver.c +++ b/drivers/oled/oled_driver.c | |||
| @@ -223,13 +223,8 @@ __attribute__((weak)) bool oled_send_cmd_P(const uint8_t *data, uint16_t size) { | |||
| 223 | spi_stop(); | 223 | spi_stop(); |
| 224 | return (status >= 0); | 224 | return (status >= 0); |
| 225 | # elif defined(OLED_TRANSPORT_I2C) | 225 | # elif defined(OLED_TRANSPORT_I2C) |
| 226 | i2c_status_t status = i2c_start((OLED_DISPLAY_ADDRESS << 1) | I2C_WRITE, OLED_I2C_TIMEOUT); | ||
| 227 | 226 | ||
| 228 | for (uint16_t i = 0; i < size && status >= 0; i++) { | 227 | i2c_status_t status = i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), data, size, OLED_I2C_TIMEOUT); |
| 229 | status = i2c_write(pgm_read_byte((const char *)data++), OLED_I2C_TIMEOUT); | ||
| 230 | } | ||
| 231 | |||
| 232 | i2c_stop(); | ||
| 233 | 228 | ||
| 234 | return (status == I2C_STATUS_SUCCESS); | 229 | return (status == I2C_STATUS_SUCCESS); |
| 235 | # endif | 230 | # endif |
