Version 1.4.3E.

This commit is contained in:
GuruSR 2022-04-04 11:41:06 -04:00 committed by GitHub
parent 2641e7ff76
commit 58c34d1bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 40 deletions

View File

@ -69,43 +69,45 @@ RTC_DATA_ATTR struct Optional final {
RTC_DATA_ATTR struct Designing final { RTC_DATA_ATTR struct Designing final {
struct MenuPOS { struct MenuPOS {
byte Gutter; // 3 byte Gutter; // 3
byte Top; // MenuTop 72 byte Top; // MenuTop 72
byte Header; // HeaderY 97 byte Header; // HeaderY 97
byte Data; // DataY 138 byte Data; // DataY 138
const GFXfont *Font; // Menu Font. const GFXfont *Font; // Menu Font.
const GFXfont *FontSmall; // Menu Font. const GFXfont *FontSmall; // Menu Font.
const GFXfont *FontSmaller; // Menu Font. const GFXfont *FontSmaller; // Menu Font.
} Menu; } Menu;
struct FacePOS { struct FacePOS {
byte Gutter; // 4 const unsigned char *Bitmap; // Null
byte Time; // TimeY 56 const unsigned char *SleepBitmap; // Null
byte TimeHeight; // 45 byte Gutter; // 4
uint16_t TimeColor; // Font Color. byte Time; // TimeY 56
const GFXfont *TimeFont; // Font. byte TimeHeight; // 45
WatchyGSR::DesOps TimeStyle; // dCENTER uint16_t TimeColor; // Font Color.
byte TimeLeft; // Only for dSTATIC const GFXfont *TimeFont; // Font.
byte Day; // DayY 101 WatchyGSR::DesOps TimeStyle; // dCENTER
byte DayGutter; // 4 byte TimeLeft; // Only for dSTATIC
uint16_t DayColor; // Font Color. byte Day; // DayY 101
const GFXfont *DayFont; // Font. byte DayGutter; // 4
const GFXfont *DayFontSmall; // Font. uint16_t DayColor; // Font Color.
const GFXfont *DayFontSmaller; // Font. const GFXfont *DayFont; // Font.
WatchyGSR::DesOps DayStyle; // dCENTER const GFXfont *DayFontSmall; // Font.
byte DayLeft; // Only for dSTATIC const GFXfont *DayFontSmaller; // Font.
byte Date; // DateY 143 WatchyGSR::DesOps DayStyle; // dCENTER
byte DateGutter; // 4 byte DayLeft; // Only for dSTATIC
uint16_t DateColor; // Font Color. byte Date; // DateY 143
const GFXfont *DateFont; // Font. byte DateGutter; // 4
const GFXfont *DateFontSmall; // Font. uint16_t DateColor; // Font Color.
const GFXfont *DateFontSmaller; // Font. const GFXfont *DateFont; // Font.
WatchyGSR::DesOps DateStyle; // dCENTER const GFXfont *DateFontSmall; // Font.
byte DateLeft; // Only for dSTATIC const GFXfont *DateFontSmaller; // Font.
byte Year; // YearY 186 WatchyGSR::DesOps DateStyle; // dCENTER
uint16_t YearColor; // Font Color. byte DateLeft; // Only for dSTATIC
const GFXfont *YearFont; // Font. byte Year; // YearY 186
WatchyGSR::DesOps YearStyle; // dCENTER uint16_t YearColor; // Font Color.
byte YearLeft; // Only for dSTATIC const GFXfont *YearFont; // Font.
WatchyGSR::DesOps YearStyle; // dCENTER
byte YearLeft; // Only for dSTATIC
} Face; } Face;
struct StatusPOS { struct StatusPOS {
byte WIFIx; // NTPX 5 byte WIFIx; // NTPX 5
@ -380,7 +382,7 @@ void WatchyGSR::init(String datetime){
} }
if ((Battery.Last > Battery.LowLevel || Button != 0 || Updates.Tapped || Darkness.Woke) && !(Options.SleepStyle == 4 && Darkness.Went && !Updates.Tapped)){ if (((Battery.Last > Battery.LowLevel || Button != 0 || Updates.Tapped || Darkness.Woke) && !(Options.SleepStyle == 4 && Darkness.Went && !Updates.Tapped)) || (Battery.DarkState != Battery.State)){
//Init interrupts. //Init interrupts.
attachInterrupt(digitalPinToInterrupt(MENU_PIN), std::bind(&WatchyGSR::handleInterrupt,this), HIGH); attachInterrupt(digitalPinToInterrupt(MENU_PIN), std::bind(&WatchyGSR::handleInterrupt,this), HIGH);
attachInterrupt(digitalPinToInterrupt(BACK_PIN), std::bind(&WatchyGSR::handleInterrupt,this), HIGH); attachInterrupt(digitalPinToInterrupt(BACK_PIN), std::bind(&WatchyGSR::handleInterrupt,this), HIGH);
@ -733,7 +735,7 @@ void WatchyGSR::showWatchFace(){
void WatchyGSR::drawWatchFace(){ void WatchyGSR::drawWatchFace(){
display.fillScreen(BackColor()); display.fillScreen(BackColor());
InsertBitmap(); if (!OverrideBitmap()) if (Design.Face.Bitmap) display.drawBitmap(0, 0, Design.Face.Bitmap, 200, 200, ForeColor(), BackColor());
display.setTextColor(ForeColor()); display.setTextColor(ForeColor());
drawWatchFaceStyle(); drawWatchFaceStyle();
@ -1300,6 +1302,7 @@ void WatchyGSR::GoDark(){
display.setFullWindow(); display.setFullWindow();
DisplayInit(true); // Force it here so it fixes the border. DisplayInit(true); // Force it here so it fixes the border.
display.fillScreen(GxEPD_BLACK); display.fillScreen(GxEPD_BLACK);
if (!OverrideSleepBitmap()) if (Design.Face.SleepBitmap) display.drawBitmap(0, 0, Design.Face.SleepBitmap, 200, 200, ForeColor(), BackColor());
drawChargeMe(true); drawChargeMe(true);
Battery.DarkDirection = Battery.Direction; Battery.DarkDirection = Battery.Direction;
Battery.DarkState = Battery.State; Battery.DarkState = Battery.State;
@ -2446,7 +2449,8 @@ uint16_t WatchyGSR::ForeColor(){ return (Options.LightMode ? GxEPD_BLACK : GxEPD
uint16_t WatchyGSR::BackColor(){ return (Options.LightMode ? GxEPD_WHITE : GxEPD_BLACK); } uint16_t WatchyGSR::BackColor(){ return (Options.LightMode ? GxEPD_WHITE : GxEPD_BLACK); }
void WatchyGSR::InsertPost() {} void WatchyGSR::InsertPost() {}
void WatchyGSR::InsertBitmap() {} bool WatchyGSR::OverrideBitmap() { return false; }
bool WatchyGSR::OverrideSleepBitmap() { return false; }
void WatchyGSR::InsertDefaults() {} void WatchyGSR::InsertDefaults() {}
void WatchyGSR::InsertOnMinute() {} void WatchyGSR::InsertOnMinute() {}
void WatchyGSR::InsertWiFi() {} void WatchyGSR::InsertWiFi() {}
@ -3325,6 +3329,8 @@ void WatchyGSR::initWatchFaceStyle(){
Design.Menu.Font = &aAntiCorona12pt7b; Design.Menu.Font = &aAntiCorona12pt7b;
Design.Menu.FontSmall = &aAntiCorona11pt7b; Design.Menu.FontSmall = &aAntiCorona11pt7b;
Design.Menu.FontSmaller = &aAntiCorona10pt7b; Design.Menu.FontSmaller = &aAntiCorona10pt7b;
Design.Face.Bitmap = nullptr;
Design.Face.SleepBitmap = nullptr;
Design.Face.Gutter = 4; Design.Face.Gutter = 4;
Design.Face.Time = 56; Design.Face.Time = 56;
Design.Face.TimeHeight = 45; Design.Face.TimeHeight = 45;
@ -3367,6 +3373,8 @@ void WatchyGSR::initWatchFaceStyle(){
Design.Menu.Font = &aAntiCorona12pt7b; Design.Menu.Font = &aAntiCorona12pt7b;
Design.Menu.FontSmall = &aAntiCorona11pt7b; Design.Menu.FontSmall = &aAntiCorona11pt7b;
Design.Menu.FontSmaller = &aAntiCorona10pt7b; Design.Menu.FontSmaller = &aAntiCorona10pt7b;
Design.Face.Bitmap = nullptr;
Design.Face.SleepBitmap = nullptr;
Design.Face.Gutter = 4; Design.Face.Gutter = 4;
Design.Face.Time = 56; Design.Face.Time = 56;
Design.Face.TimeHeight = 45; Design.Face.TimeHeight = 45;

View File

@ -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.3D"; static constexpr const char* Build = "1.4.3E";
enum DesOps {dSTATIC, dLEFT, dRIGHT, dCENTER}; enum DesOps {dSTATIC, dLEFT, dRIGHT, dCENTER};
public: public:
WatchyGSR(); WatchyGSR();
@ -65,7 +65,8 @@ class WatchyGSR{
virtual uint16_t ForeColor() final; virtual uint16_t ForeColor() final;
virtual uint16_t BackColor() final; virtual uint16_t BackColor() final;
void InsertPost(); void InsertPost();
void InsertBitmap(); bool OverrideBitmap();
bool OverrideSleepBitmap();
void InsertDefaults(); void InsertDefaults();
void InsertOnMinute(); void InsertOnMinute();
void InsertWiFi(); void InsertWiFi();