diff --git a/examples/Example_Fast_Line/Example_Fast_Line.ino b/examples/Example_Fast_Line/Example_Fast_Line.ino index db4241e..a13cd53 100755 --- a/examples/Example_Fast_Line/Example_Fast_Line.ino +++ b/examples/Example_Fast_Line/Example_Fast_Line.ino @@ -48,10 +48,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - mySerial..print(formatString(" > %i \r", i)); + mySerial.print(formatString(" > %i \r", i)); delay(1000); } - mySerial..print(" \r"); + mySerial.print(" \r"); } // Functions @@ -62,8 +62,8 @@ void flush_ms() { uint32_t chrono = (uint32_t)millis(); myScreen.flush(); - mySerial..print(millis() - chrono); - mySerial..println(" ms"); + mySerial.print(millis() - chrono); + mySerial.println(" ms"); } #if (DISPLAY_FAST_LINE == 1) @@ -92,7 +92,7 @@ void displayFastLine() myScreen.dRectangle(index, dy, 32, dy * 4, myColours.grey); chrono = millis(); myScreen.flush(); - mySerial..println(formatString("%i - %i = %i", chrono, millis(), millis() - chrono)); + mySerial.println(formatString("%i - %i = %i", chrono, millis(), millis() - chrono)); } } @@ -104,32 +104,32 @@ void displayFastLine() /// void setup() { - mySerial..begin(115200); + mySerial.begin(115200); delay(500); - mySerial..println(); - mySerial..println("=== " __FILE__); - mySerial..println("=== " __DATE__ " " __TIME__); - mySerial..println(); + mySerial.println(); + mySerial.println("=== " __FILE__); + mySerial.println("=== " __DATE__ " " __TIME__); + mySerial.println(); - mySerial..print("begin... "); + mySerial.print("begin... "); myScreen.begin(); - mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); #if (DISPLAY_FAST_LINE == 1) - mySerial..println("DISPLAY_FAST_LINE... "); + mySerial.println("DISPLAY_FAST_LINE... "); myScreen.clear(); displayFastLine(); wait(4); #endif // DISPLAY_FAST_LINE - mySerial..println("White... "); + mySerial.println("White... "); myScreen.clear(); flush_ms(); - mySerial..println("=== "); - mySerial..println(); + mySerial.println("=== "); + mySerial.println(); } // Add loop code diff --git a/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino b/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino index cd70742..8a49856 100755 --- a/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino +++ b/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino @@ -48,10 +48,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - mySerial..print(formatString(" > %i \r", i)); + mySerial.print(formatString(" > %i \r", i)); delay(1000); } - mySerial..print(" \r"); + mySerial.print(" \r"); } // Functions @@ -62,8 +62,8 @@ void flush_ms() { uint32_t chrono = (uint32_t)millis(); myScreen.flush(); - mySerial..print(millis() - chrono); - mySerial..println(" ms"); + mySerial.print(millis() - chrono); + mySerial.println(" ms"); } #if (DISPLAY_FAST_ORIENTATION == 1) @@ -89,32 +89,32 @@ void displayFastOrientation() /// void setup() { - mySerial..begin(115200); + mySerial.begin(115200); delay(500); - mySerial..println(); - mySerial..println("=== " __FILE__); - mySerial..println("=== " __DATE__ " " __TIME__); - mySerial..println(); + mySerial.println(); + mySerial.println("=== " __FILE__); + mySerial.println("=== " __DATE__ " " __TIME__); + mySerial.println(); - mySerial..print("begin... "); + mySerial.print("begin... "); myScreen.begin(); - mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); #if (DISPLAY_FAST_ORIENTATION == 1) - mySerial..println("DISPLAY_FAST_ORIENTATION... "); + mySerial.println("DISPLAY_FAST_ORIENTATION... "); myScreen.clear(); displayFastOrientation(); wait(4); #endif // DISPLAY_FAST_ORIENTATION - mySerial..println("White... "); + mySerial.println("White... "); myScreen.clear(); flush_ms(); - mySerial..println("=== "); - mySerial..println(); + mySerial.println("=== "); + mySerial.println(); } // Add loop code diff --git a/examples/Example_Fast_Speed/Example_Fast_Speed.ino b/examples/Example_Fast_Speed/Example_Fast_Speed.ino index d6bcd3d..8ef0bc8 100755 --- a/examples/Example_Fast_Speed/Example_Fast_Speed.ino +++ b/examples/Example_Fast_Speed/Example_Fast_Speed.ino @@ -55,10 +55,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - mySerial..print(formatString(" > %i \r", i)); + mySerial.print(formatString(" > %i \r", i)); delay(1000); } - mySerial..print(" \r"); + mySerial.print(" \r"); } // Functions @@ -84,7 +84,7 @@ void performTest() // 0 dy = (dz - myScreen.characterSizeY()) / 2; text = myScreen.WhoAmI() + " - " + String(SCREEN_EPD_EXT3_RELEASE); - mySerial..println(text); + mySerial.println(text); dx = (x - myScreen.stringSizeX(text)) / 2; myScreen.gText(dx, dy, text); myScreen.dRectangle(0, dz * 0, x, dz, myColours.black); @@ -97,7 +97,7 @@ void performTest() dy += dz; // text = formatString("Global update= %i ms", chrono); text = formatString("Fast update= %i ms", chrono); - mySerial..println(text); + mySerial.println(text); dx = (x - myScreen.stringSizeX(text)) / 2; myScreen.gText(dx, dy, text); myScreen.dRectangle(0, dz * 1, x, dz, myColours.black); @@ -111,28 +111,28 @@ void performTest() /// void setup() { - mySerial..begin(115200); + mySerial.begin(115200); delay(500); - mySerial..println(); - mySerial..println("=== " __FILE__); - mySerial..println("=== " __DATE__ " " __TIME__); - mySerial..println(); + mySerial.println(); + mySerial.println("=== " __FILE__); + mySerial.println("=== " __DATE__ " " __TIME__); + mySerial.println(); - mySerial..println("begin... "); + mySerial.println("begin... "); myScreen.begin(); - mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); - mySerial..println("Speed... "); + mySerial.println("Speed... "); myScreen.clear(); performTest(); wait(8); - mySerial..println("White... "); + mySerial.println("White... "); myScreen.clear(); myScreen.flush(); - mySerial..println("=== "); - mySerial..println(); + mySerial.println("=== "); + mySerial.println(); } // Add loop code diff --git a/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino b/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino index afbce3b..a9efea5 100644 --- a/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino +++ b/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino @@ -49,16 +49,16 @@ void check(int8_t temperatureC, uint8_t expectedMode) uint8_t recommendedMode = myScreen.checkTemperatureMode(expectedMode); // Raspberry Pi SDK core for RP2040 - // mySerial..printf("Temperature= %+3i C - Mode: %8s -> %-8s", temperatureC, stringMode[expectedMode], stringMode[recommendedMode]); + // mySerial.printf("Temperature= %+3i C - Mode: %8s -> %-8s", temperatureC, stringMode[expectedMode], stringMode[recommendedMode]); // Arduino core for RP2040 - mySerial..print("Temperature= "); - mySerial..print(temperatureC); - mySerial..print(" C - Mode: "); - mySerial..print(stringMode[expectedMode]); - mySerial..print(" -> "); - mySerial..print(stringMode[recommendedMode]); - mySerial..println(); + mySerial.print("Temperature= "); + mySerial.print(temperatureC); + mySerial.print(" C - Mode: "); + mySerial.print(stringMode[expectedMode]); + mySerial.print(" -> "); + mySerial.print(stringMode[recommendedMode]); + mySerial.println(); } void performTest() @@ -78,22 +78,22 @@ void performTest() /// void setup() { - mySerial..begin(115200); + mySerial.begin(115200); - mySerial..println(); - mySerial..println("=== " __FILE__); - mySerial..println("=== " __DATE__ " " __TIME__); - mySerial..println(); + mySerial.println(); + mySerial.println("=== " __FILE__); + mySerial.println("=== " __DATE__ " " __TIME__); + mySerial.println(); // Screen myScreen.begin(); - mySerial..println(formatString("=== %s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial.println(formatString("=== %s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); performTest(); - mySerial..println("=== "); - mySerial..println(); + mySerial.println("=== "); + mySerial.println(); } // Add loop code diff --git a/src/Screen_EPD_EXT3.cpp b/src/Screen_EPD_EXT3.cpp index ef67036..2db4233 100755 --- a/src/Screen_EPD_EXT3.cpp +++ b/src/Screen_EPD_EXT3.cpp @@ -175,7 +175,7 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() // Application note § 3. Read OTP memory // Register 0x50 flag - // Additional settings for fast update, 154 213 266 and 370 screens (s_flag50) + // Additional settings for fast update, 154 206 213 266 271A 370 and 437 screens (s_flag50) switch (u_eScreen_EPD) { case eScreen_EPD_154_PS_0C: @@ -211,12 +211,6 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() // GPIO COG_reset(); // Although not mentioned, reset to ensure stable state - // Debug -#if (DEBUG_OTP == 1) - uint8_t debugOTP[4096] = {0x00}; - uint16_t debugIndex = 0; -#endif // DEBUG_OTP - // Read OTP uint8_t ui8 = 0; uint16_t offsetA5 = 0x0000; @@ -240,11 +234,6 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() digitalWrite(b_pin.panelCS, HIGH); // Unselect // hV_HAL_log(LEVEL_INFO, "ui8= 0x%02x", ui8); -#if (DEBUG_OTP == 1) - debugOTP[debugIndex] = ui8; - debugIndex += 1; -#endif // DEBUG_OTP - // Check bank uint8_t bank = ((ui8 == 0xa5) ? 0 : 1); @@ -327,22 +316,12 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() digitalWrite(b_pin.panelCS, LOW); // Select ui8 = hV_HAL_SPI3_read(); digitalWrite(b_pin.panelCS, HIGH); // Unselect - -#if (DEBUG_OTP == 1) - debugOTP[debugIndex] = ui8; - debugIndex += 1; -#endif // DEBUG_OTP } digitalWrite(b_pin.panelCS, LOW); // Select ui8 = hV_HAL_SPI3_read(); // First byte to be checked digitalWrite(b_pin.panelCS, HIGH); // Unselect -#if (DEBUG_OTP == 1) - debugOTP[debugIndex] = ui8; - debugIndex += 1; -#endif // DEBUG_OTP - if (ui8 != 0xa5) { mySerial.println(); @@ -360,11 +339,6 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() digitalWrite(b_pin.panelCS, LOW); // Select ui8 = hV_HAL_SPI3_read(); digitalWrite(b_pin.panelCS, HIGH); // Unselect - -#if (DEBUG_OTP == 1) - debugOTP[debugIndex] = ui8; - debugIndex += 1; -#endif // DEBUG_OTP } // Populate COG_initialData @@ -374,20 +348,15 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() ui8 = hV_HAL_SPI3_read(); // Read OTP COG_initialData[index] = ui8; digitalWrite(b_pin.panelCS, HIGH); // Unselect - -#if (DEBUG_OTP == 1) - debugOTP[debugIndex] = ui8; - debugIndex += 1; -#endif // DEBUG_OTP } u_flagOTP = true; // Debug COG_initialData #if (DEBUG_OTP == 1) - debugIndex |= 0x0f; - debugIndex += 1; - mySerial.print(formatString("const uint8_t debugOTP[%i] =", debugIndex)); + uint8_t debugIndex = u_readBytes; + + mySerial.print(formatString("const uint8_t COG_initialData[%i] =", debugIndex)); mySerial.println(); mySerial.print("{"); for (uint16_t index = 0; index < debugIndex; index += 1) @@ -398,7 +367,7 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() mySerial.print(" "); } - mySerial.print(formatString("0x%02x", debugOTP[index])); + mySerial.print(formatString("0x%02x", COG_initialData[index])); mySerial.print(formatString("%s ", (index + 1 < debugIndex ? "," : " "))); // no comma on last value if (((index + 1) % 8) == 0) @@ -415,6 +384,7 @@ void Screen_EPD_EXT3_Fast::COG_getDataOTP() void Screen_EPD_EXT3_Fast::COG_sendImageDataFast() { + // Application note § 5. Input image to the EPD uint8_t * nextBuffer = u_newImage; uint8_t * previousBuffer = u_newImage + u_pageColourSize; @@ -511,7 +481,7 @@ void Screen_EPD_EXT3_Fast::begin() mySerial.println(); mySerial.println(formatString("hV * Screen %i-%cS-0%c with no fast update", u_codeSize, u_codeFilm, u_codeDriver)); - while (true); + while (0x01); break; } @@ -641,15 +611,16 @@ void Screen_EPD_EXT3_Fast::begin() mySerial.println(); mySerial.println(formatString("hV * Screen %i-%cS-0%c is not supported", u_codeSize, u_codeFilm, u_codeDriver)); - while (true); + while (0x01); break; } // u_codeSize v_screenDiagonal = u_codeSize; // Report - mySerial.println(formatString("= Screen %s %ix%i", WhoAmI().c_str(), screenSizeX(), screenSizeY())); - mySerial.println(formatString("= PDLS %s v%i.%i.%i", SCREEN_EPD_EXT3_VARIANT, SCREEN_EPD_EXT3_RELEASE / 100, (SCREEN_EPD_EXT3_RELEASE / 10) % 10, SCREEN_EPD_EXT3_RELEASE % 10)); - + mySerial.println(formatString("hV = Screen %s %ix%i", WhoAmI().c_str(), screenSizeX(), screenSizeY())); + mySerial.println(formatString("hV = Number %i-%cS-0%c", u_codeSize, u_codeFilm, u_codeDriver)); + mySerial.println(formatString("hV = PDLS %s v%i.%i.%i", SCREEN_EPD_EXT3_VARIANT, SCREEN_EPD_EXT3_RELEASE / 100, (SCREEN_EPD_EXT3_RELEASE / 10) % 10, SCREEN_EPD_EXT3_RELEASE % 10)); + mySerial.println(); u_bufferDepth = v_screenColourBits; // 2 colours u_bufferSizeV = v_screenSizeV; // vertical = wide size @@ -777,6 +748,7 @@ uint8_t Screen_EPD_EXT3_Fast::flushMode(uint8_t updateMode) default: + mySerial.println(); mySerial.println("hV ! PDLS - UPDATE_NONE invoked"); break; }