@@ -281,16 +281,18 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
281
281
}
282
282
}
283
283
284
- void Adafruit_EPD::writeRAMFramebufferToEPD (uint8_t *framebuffer, uint32_t framebuffer_size,
285
- uint8_t EPDlocation, bool invertdata) {
284
+ void Adafruit_EPD::writeRAMFramebufferToEPD (uint8_t *framebuffer,
285
+ uint32_t framebuffer_size,
286
+ uint8_t EPDlocation,
287
+ bool invertdata) {
286
288
// write image
287
289
writeRAMCommand (EPDlocation);
288
290
dcHigh ();
289
- // Serial.printf("Writing from RAM location %04x: \n", &framebuffer);
291
+ // Serial.printf("Writing from RAM location %04x: \n", &framebuffer);
290
292
291
293
for (uint16_t i = 0 ; i < framebuffer_size; i++) {
292
294
uint8_t d = framebuffer[i];
293
- if (invertdata)
295
+ if (invertdata)
294
296
d = ~d;
295
297
296
298
/*
@@ -306,8 +308,10 @@ void Adafruit_EPD::writeRAMFramebufferToEPD(uint8_t *framebuffer, uint32_t frame
306
308
return ;
307
309
}
308
310
309
- void Adafruit_EPD::writeSRAMFramebufferToEPD (uint16_t SRAM_buffer_addr, uint32_t buffer_size,
310
- uint8_t EPDlocation, bool invertdata) {
311
+ void Adafruit_EPD::writeSRAMFramebufferToEPD (uint16_t SRAM_buffer_addr,
312
+ uint32_t buffer_size,
313
+ uint8_t EPDlocation,
314
+ bool invertdata) {
311
315
uint8_t c;
312
316
313
317
// use SRAM
@@ -317,11 +321,11 @@ void Adafruit_EPD::writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr, uint32_t
317
321
// send address
318
322
SPItransfer (SRAM_buffer_addr >> 8 );
319
323
SPItransfer (SRAM_buffer_addr & 0xFF );
320
-
324
+
321
325
// first data byte from SRAM will be transfered in at the same time
322
326
// as the EPD command is transferred out
323
327
c = writeRAMCommand (EPDlocation);
324
-
328
+
325
329
dcHigh ();
326
330
for (uint16_t i = 0 ; i < buffer_size; i++) {
327
331
c = SPItransfer (c);
@@ -332,8 +336,6 @@ void Adafruit_EPD::writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr, uint32_t
332
336
sram.csHigh ();
333
337
}
334
338
335
-
336
-
337
339
/* *************************************************************************/
338
340
/* !
339
341
@brief Transfer the data stored in the buffer(s) to the display
@@ -364,10 +366,10 @@ void Adafruit_EPD::display(bool sleep) {
364
366
if (buffer2_size != 0 ) {
365
367
// oh there's another buffer eh?
366
368
delay (2 );
367
-
369
+
368
370
// Set X & Y ram counters
369
371
setRAMAddress (0 , 0 );
370
-
372
+
371
373
if (use_sram) {
372
374
writeSRAMFramebufferToEPD (buffer2_addr, buffer2_size, 1 );
373
375
} else {
0 commit comments