diff --git a/src/Compilation Instructions.txt b/src/Compilation Instructions.txt index 83e65fc..12cf5aa 100644 --- a/src/Compilation Instructions.txt +++ b/src/Compilation Instructions.txt @@ -14,21 +14,30 @@ Requires Watchy base 1.2.9 or greater, as well as the above libraries. When edi You'll need to edit 2 files: +**NOTE** The two files can be found in Arduino->Libraries->GxEPD2->src->epd (for PlatformIO, you'll need to look where it is stored for your setup). + GxEPD2_154_D67.cpp: -Insert the following code past the following: (Note, the uint8/16_t's below can either be uint8_t or uint16_t based on GxEPD2 version, don't copy those lines.) +Copy the code below: + +bool IsDark; // GuruSR: Changed for setDarkBorder +void GxEPD2_154_D67::setDarkBorder(bool Dark){ // GuruSR: Changed for setDarkBorder + IsDark=Dark; // GuruSR: Changed for setDarkBorder +} // GuruSR: Changed for setDarkBorder + +And add it to just under this code: (Note, the uint8/16_t's below can either be uint8_t or uint16_t based on GxEPD2 version, don't copy those lines.) GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) : GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) { } -to read: +So when you're done, it looks like this: -GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) : <- DO NOT COPY THIS - GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) <- DO NOT COPY THIS -{ <- DO NOT COPY THIS -} <- DO NOT COPY THIS +GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} bool IsDark; // GuruSR: Changed for setDarkBorder void GxEPD2_154_D67::setDarkBorder(bool Dark){ // GuruSR: Changed for setDarkBorder @@ -49,7 +58,7 @@ void GxEPD2_154_D67::_InitDisplay() _writeData(0x00); _writeData(0x00); _writeCommand(0x3C); // BorderWavefrom - _writeData(0x05); + _writeData(0x05); <- THIS LINE NEEDS TO BE CHANGED, LOOK BELOW! _writeCommand(0x18); // Read built-in temperature sensor _writeData(0x80); _setPartialRamArea(0, 0, WIDTH, HEIGHT); @@ -74,11 +83,23 @@ void GxEPD2_154_D67::_InitDisplay() _setPartialRamArea(0, 0, WIDTH, HEIGHT); <- DO NOT COPY THIS } -Edit GxEPD2_154_D67.h to include the following after: +Edit GxEPD2_154_D67.h: + +After: +#define _GxEPD2_154_D67_H_ + +Add: +#define GxEPD2DarkBorder + +It should look like this: +#define _GxEPD2_154_D67_H_ +#define GxEPD2DarkBorder + +Further down look for: void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) -to: +Add the void setDarkBorder line below after the line above so it looks like: void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) void setDarkBorder(bool Dark); // GuruSR: Changed for setDarkBorder diff --git a/src/Watchy_GSR.cpp b/src/Watchy_GSR.cpp index f3aa3f4..f3a8017 100644 --- a/src/Watchy_GSR.cpp +++ b/src/Watchy_GSR.cpp @@ -386,6 +386,9 @@ void WatchyGSR::init(String datetime){ Darkness.Woke=true; Darkness.Last=millis(); Darkness.Tilt=Darkness.Last; +#ifndef GxEPD2DarkBorder + Options.Border=false; +#endif break; } @@ -1774,12 +1777,14 @@ void WatchyGSR::handleButtonPress(uint8_t Pressed){ UpdateDisp = true; // Quick Update. SetTurbo(); }else if (Menu.Item == MENU_BRDR){ // Border Mode +#ifdef GxEPD2DarkBorder Options.Border = !Options.Border; Options.NeedsSaving = true; Updates.Init = true; DoHaptic = true; UpdateDisp = true; // Quick Update. SetTurbo(); +#endif }else if (Menu.Item == MENU_ORNT){ // Watchy Orientation Options.Orientated = !Options.Orientated; Options.NeedsSaving = true; @@ -3108,7 +3113,11 @@ void WatchyGSR::StoreSettings(String FromUser){ Options.TwentyFour = (V & 1) ? true : false; Options.LightMode = (V & 2) ? true : false; Options.Feedback = (V & 4) ? true : false; +#ifdef GxEPD2DarkBorder Options.Border = (V & 8) ? true : false; +#else + Options.Border = false; +#endif Options.Lefty = (V & 16) ? true : false; Options.Swapped = (V & 32) ? true : false; Options.Orientated = (V & 64) ? true : false; @@ -3300,7 +3309,9 @@ uint8_t WatchyGSR::getTXOffset(wifi_power_t Current){ } void WatchyGSR::DisplayInit(bool ForceDark){ +#ifdef GxEPD2DarkBorder display.epd2.setDarkBorder(Options.Border | ForceDark); +#endif if (Updates.Init){ display.init(0,Rebooted,10,true); // Force it here so it fixes the border. Updates.Init=false; diff --git a/src/Watchy_GSR.h b/src/Watchy_GSR.h index a8f89cc..444e4e9 100644 --- a/src/Watchy_GSR.h +++ b/src/Watchy_GSR.h @@ -39,7 +39,7 @@ class WatchyGSR{ static SmallRTC SRTC; static SmallNTP SNTP; static GxEPD2_BW display; - static constexpr const char* Build = "1.4.3G"; + static constexpr const char* Build = "1.4.3H"; enum DesOps {dSTATIC, dLEFT, dRIGHT, dCENTER}; public: