Version 1.4.3H.
This commit is contained in:
parent
cf4420e425
commit
393678530f
@ -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:
|
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:
|
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_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)
|
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_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) <- 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
|
}
|
||||||
|
|
||||||
bool IsDark; // GuruSR: Changed for setDarkBorder
|
bool IsDark; // GuruSR: Changed for setDarkBorder
|
||||||
void GxEPD2_154_D67::setDarkBorder(bool Dark){ // 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);
|
||||||
_writeData(0x00);
|
_writeData(0x00);
|
||||||
_writeCommand(0x3C); // BorderWavefrom
|
_writeCommand(0x3C); // BorderWavefrom
|
||||||
_writeData(0x05);
|
_writeData(0x05); <- THIS LINE NEEDS TO BE CHANGED, LOOK BELOW!
|
||||||
_writeCommand(0x18); // Read built-in temperature sensor
|
_writeCommand(0x18); // Read built-in temperature sensor
|
||||||
_writeData(0x80);
|
_writeData(0x80);
|
||||||
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
|
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
|
||||||
@ -74,11 +83,23 @@ void GxEPD2_154_D67::_InitDisplay()
|
|||||||
_setPartialRamArea(0, 0, WIDTH, HEIGHT); <- DO NOT COPY THIS
|
_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)
|
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 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
|
void setDarkBorder(bool Dark); // GuruSR: Changed for setDarkBorder
|
||||||
|
|||||||
@ -386,6 +386,9 @@ void WatchyGSR::init(String datetime){
|
|||||||
Darkness.Woke=true;
|
Darkness.Woke=true;
|
||||||
Darkness.Last=millis();
|
Darkness.Last=millis();
|
||||||
Darkness.Tilt=Darkness.Last;
|
Darkness.Tilt=Darkness.Last;
|
||||||
|
#ifndef GxEPD2DarkBorder
|
||||||
|
Options.Border=false;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1774,12 +1777,14 @@ void WatchyGSR::handleButtonPress(uint8_t Pressed){
|
|||||||
UpdateDisp = true; // Quick Update.
|
UpdateDisp = true; // Quick Update.
|
||||||
SetTurbo();
|
SetTurbo();
|
||||||
}else if (Menu.Item == MENU_BRDR){ // Border Mode
|
}else if (Menu.Item == MENU_BRDR){ // Border Mode
|
||||||
|
#ifdef GxEPD2DarkBorder
|
||||||
Options.Border = !Options.Border;
|
Options.Border = !Options.Border;
|
||||||
Options.NeedsSaving = true;
|
Options.NeedsSaving = true;
|
||||||
Updates.Init = true;
|
Updates.Init = true;
|
||||||
DoHaptic = true;
|
DoHaptic = true;
|
||||||
UpdateDisp = true; // Quick Update.
|
UpdateDisp = true; // Quick Update.
|
||||||
SetTurbo();
|
SetTurbo();
|
||||||
|
#endif
|
||||||
}else if (Menu.Item == MENU_ORNT){ // Watchy Orientation
|
}else if (Menu.Item == MENU_ORNT){ // Watchy Orientation
|
||||||
Options.Orientated = !Options.Orientated;
|
Options.Orientated = !Options.Orientated;
|
||||||
Options.NeedsSaving = true;
|
Options.NeedsSaving = true;
|
||||||
@ -3108,7 +3113,11 @@ void WatchyGSR::StoreSettings(String FromUser){
|
|||||||
Options.TwentyFour = (V & 1) ? true : false;
|
Options.TwentyFour = (V & 1) ? true : false;
|
||||||
Options.LightMode = (V & 2) ? true : false;
|
Options.LightMode = (V & 2) ? true : false;
|
||||||
Options.Feedback = (V & 4) ? true : false;
|
Options.Feedback = (V & 4) ? true : false;
|
||||||
|
#ifdef GxEPD2DarkBorder
|
||||||
Options.Border = (V & 8) ? true : false;
|
Options.Border = (V & 8) ? true : false;
|
||||||
|
#else
|
||||||
|
Options.Border = false;
|
||||||
|
#endif
|
||||||
Options.Lefty = (V & 16) ? true : false;
|
Options.Lefty = (V & 16) ? true : false;
|
||||||
Options.Swapped = (V & 32) ? true : false;
|
Options.Swapped = (V & 32) ? true : false;
|
||||||
Options.Orientated = (V & 64) ? 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){
|
void WatchyGSR::DisplayInit(bool ForceDark){
|
||||||
|
#ifdef GxEPD2DarkBorder
|
||||||
display.epd2.setDarkBorder(Options.Border | ForceDark);
|
display.epd2.setDarkBorder(Options.Border | ForceDark);
|
||||||
|
#endif
|
||||||
if (Updates.Init){
|
if (Updates.Init){
|
||||||
display.init(0,Rebooted,10,true); // Force it here so it fixes the border.
|
display.init(0,Rebooted,10,true); // Force it here so it fixes the border.
|
||||||
Updates.Init=false;
|
Updates.Init=false;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class WatchyGSR{
|
|||||||
static SmallRTC SRTC;
|
static SmallRTC SRTC;
|
||||||
static SmallNTP SNTP;
|
static SmallNTP SNTP;
|
||||||
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
||||||
static constexpr const char* Build = "1.4.3G";
|
static constexpr const char* Build = "1.4.3H";
|
||||||
enum DesOps {dSTATIC, dLEFT, dRIGHT, dCENTER};
|
enum DesOps {dSTATIC, dLEFT, dRIGHT, dCENTER};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user