File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 3939#define _min min
4040#define _max max
4141#endif
42+ #if defined(ARDUINO_ARCH_ESP32)
43+ #define I2C_MAX_TRANSFER_BYTE 128 /* * ESP32 can Transfer 128 bytes */
44+ #else
45+ #define I2C_MAX_TRANSFER_BYTE 17
46+ #endif
4247// --------------------------------------
4348
4449class SSD1306Wire : public OLEDDisplay {
@@ -147,7 +152,7 @@ class SSD1306Wire : public OLEDDisplay {
147152
148153 _wire->write (buffer[x + y * this ->width ()]);
149154 k++;
150- if (k == 16 ) {
155+ if (k == (I2C_MAX_TRANSFER_BYTE - 1 ) ) {
151156 _wire->endTransmission ();
152157 k = 0 ;
153158 }
@@ -170,7 +175,7 @@ class SSD1306Wire : public OLEDDisplay {
170175 for (uint16_t i=0 ; i < displayBufferSize; i++) {
171176 _wire->beginTransmission (this ->_address );
172177 _wire->write (0x40 );
173- for (uint8_t x = 0 ; x < 16 ; x++) {
178+ for (uint8_t x = 0 ; x < (I2C_MAX_TRANSFER_BYTE - 1 ) ; x++) {
174179 _wire->write (buffer[i]);
175180 i++;
176181 }
You can’t perform that action at this time.
0 commit comments