Skip to content

Commit 81b031f

Browse files
committed
turn off debug
1 parent ff8d888 commit 81b031f

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

src/Adafruit_EPD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef _ADAFRUIT_EPD_H_
2121
#define _ADAFRUIT_EPD_H_
2222

23-
#define EPD_DEBUG
23+
//#define EPD_DEBUG
2424

2525
#define RAMBUFSIZE 64 ///< size of the ram buffer
2626

src/drivers/Adafruit_UC8151D.cpp

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ void Adafruit_UC8151D::begin(bool reset) {
104104
setBlackBuffer(1, true); // black defaults to inverted
105105
setColorBuffer(0, true); // red defaults to inverted
106106

107-
Serial.printf("Buffer1 %04x: ", &buffer1);
108-
Serial.printf("Buffer2 %04x: ", &buffer2);
109-
110107
powerDown();
111108
}
112109

@@ -255,13 +252,12 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uin
255252

256253
#ifdef EPD_DEBUG
257254
Serial.println(" Powering Up Partial");
255+
Serial.print("Partials since last full update: ");
256+
Serial.println(partialsSinceLastFullUpdate);
258257
#endif
259258

260259
powerUp();
261260

262-
Serial.print("Partials since last full update: ");
263-
Serial.println(partialsSinceLastFullUpdate);
264-
265261
// This command makes the display enter partial mode
266262
EPD_command(UC8151D_PTIN);
267263

@@ -305,32 +301,22 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uin
305301
Serial.println(" Update");
306302
#endif
307303
update();
308-
304+
305+
//Serial.println("Partial, saving old data to secondary buffer");
309306
if (use_sram) {
310-
Serial.println("MEME FIX");
311-
while (1);
307+
uint32_t remaining = buffer1_size;
308+
uint32_t offset = 0;
309+
uint8_t mcp_buf[16];
310+
while (remaining) {
311+
uint8_t to_xfer = min(sizeof(mcp_buf), remaining);
312+
313+
sram.read(buffer2_addr+offset, mcp_buf, to_xfer);
314+
sram.write(buffer1_addr+offset, mcp_buf, to_xfer);
315+
offset += to_xfer;
316+
remaining -= to_xfer;
317+
}
312318
} else {
313-
Serial.println("Partial, saving old data to secondary buffer");
314319
memcpy(buffer1, buffer2, buffer1_size); // buffer1 has the backup
315-
316-
/*
317-
Serial.println("Buffer 1");
318-
for (uint16_t i = 0; i < buffer1_size; i++) {
319-
uint8_t d = buffer1[i];
320-
Serial.printf("%02x", d);
321-
if ((i+1) % (WIDTH/8) == 0)
322-
Serial.println();
323-
}
324-
Serial.println();
325-
Serial.println("Buffer 2");
326-
for (uint16_t i = 0; i < buffer2_size; i++) {
327-
uint8_t d = buffer2[i];
328-
Serial.printf("%02x", d);
329-
if ((i+1) % (WIDTH/8) == 0)
330-
Serial.println();
331-
}
332-
*/
333-
Serial.println();
334320
}
335321

336322
partialsSinceLastFullUpdate++;

0 commit comments

Comments
 (0)