File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 39
39
#define _min min
40
40
#define _max max
41
41
#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
42
47
// --------------------------------------
43
48
44
49
class SSD1306Wire : public OLEDDisplay {
@@ -147,7 +152,7 @@ class SSD1306Wire : public OLEDDisplay {
147
152
148
153
_wire->write (buffer[x + y * this ->width ()]);
149
154
k++;
150
- if (k == 16 ) {
155
+ if (k == (I2C_MAX_TRANSFER_BYTE - 1 ) ) {
151
156
_wire->endTransmission ();
152
157
k = 0 ;
153
158
}
@@ -170,7 +175,7 @@ class SSD1306Wire : public OLEDDisplay {
170
175
for (uint16_t i=0 ; i < displayBufferSize; i++) {
171
176
_wire->beginTransmission (this ->_address );
172
177
_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++) {
174
179
_wire->write (buffer[i]);
175
180
i++;
176
181
}
You can’t perform that action at this time.
0 commit comments