Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,35 @@ void WatchyDisplay::asyncPowerOn() {
}
}

void WatchyDisplay::setDarkBorder(bool dark) {
void WatchyDisplay::drawDarkBorder(bool dark) {
if (_hibernating) return;
darkBorder = dark;
//This line overrides the intended behaviour that I want for the
//darkBorder variable. I want to set the darkBorder variable to dark
//and then paint the border always dark, not always putting the opposite
//colour of the background, like it is done here.
//darkBorder = dark;
_startTransfer();
_transferCommand(0x3C); // BorderWavefrom
_transfer(dark ? 0x02 : 0x05);
_endTransfer();
}

/*
This is a setter for the darkBorder variable. It sets the darkBorder.
*/
void WatchyDisplay::setDarkBorder(bool dark) {
if (_hibernating) return;
darkBorder = dark;
drawDarkBorder(dark);
}

/*
This is a getter for the darkBorder variable. It returns the darkBorder.
*/
bool WatchyDisplay::isDarkBorder() {
return darkBorder;
}

void WatchyDisplay::clearScreen(uint8_t value)
{
writeScreenBuffer(value);
Expand Down
4 changes: 3 additions & 1 deletion src/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class WatchyDisplay : public GxEPD2_EPD
// constructor
WatchyDisplay();
void initWatchy();
void drawDarkBorder(bool darkBorder);
void setDarkBorder(bool darkBorder);
bool isDarkBorder();
void asyncPowerOn();
void _PowerOnAsync();
bool waitingPowerOn = false;
Expand Down Expand Up @@ -76,7 +78,7 @@ class WatchyDisplay : public GxEPD2_EPD
void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)

bool darkBorder = false; // adds a dark border outside the normal screen area
bool darkBorder = true; // adds a dark border outside the normal screen area

static constexpr bool reduceBoosterTime = true; // Saves ~200ms
private:
Expand Down
65 changes: 65 additions & 0 deletions src/TimezonesGMT.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef TIMEZONES_GMT_H
#define TIMEZONES_GMT_H


// You don't need to change anything here to be able to set up GMT based time.
// If you set TIMEZONES_NON_GMT_OVERRIDE to 1 (as for get summer time and leaps),
// you must provide one location based timezone.
// 0: GMT, 1: Location timezone.

// Visit the link below.

#ifndef TIMEZONES_NON_GMT_OVERRIDE
#define TIMEZONES_NON_GMT_OVERRIDE 0
#endif

#define TIMEZONES_LENGTH 28
#define TIMEZONES_SELECTED 0

typedef struct TZ {
const char* location;
const char* timezone;
} TZ;


#ifdef TIMEZONES_NON_GMT_OVERRIDE
// https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
static TZ tz_override = {
"Europe/Madrid",
"CET-1CEST,M3.5.0,M10.5.0/3"
};
#endif


static TZ timeZones[] = {
{"Etc/GMT+0","GMT0"}, // 0
{"Etc/GMT+1","<-01>1"}, // 1
{"Etc/GMT+2","<-02>2"}, // 2
{"Etc/GMT+3","<-03>3"}, // 3
{"Etc/GMT+4","<-04>4"}, // 4
{"Etc/GMT+5","<-05>5"}, // 5
{"Etc/GMT+6","<-06>6"}, // 6
{"Etc/GMT+7","<-07>7"}, // 7
{"Etc/GMT+8","<-08>8"}, // 8
{"Etc/GMT+9","<-09>9"}, // 9
{"Etc/GMT+10","<-10>10"}, // 10
{"Etc/GMT+11","<-11>11"}, // 11
{"Etc/GMT+12","<-12>12"}, // 12
{"Etc/GMT-0","GMT0"}, // 13
{"Etc/GMT-1","<+01>-1"}, // 14
{"Etc/GMT-2","<+02>-2"}, // 15
{"Etc/GMT-3","<+03>-3"}, // 16
{"Etc/GMT-4","<+04>-4"}, // 17
{"Etc/GMT-5","<+05>-5"}, // 18
{"Etc/GMT-6","<+06>-6"}, // 19
{"Etc/GMT-7","<+07>-7"}, // 20
{"Etc/GMT-8","<+08>-8"}, // 21
{"Etc/GMT-9","<+09>-9"}, // 22
{"Etc/GMT-10","<+10>-10"}, // 23
{"Etc/GMT-11","<+11>-11"}, // 24
{"Etc/GMT-12","<+12>-12"}, // 25
{"Etc/GMT-13","<+13>-13"}, // 26
{"Etc/GMT-14","<+14>-14"}, // 27
};

#endif //TIMEZONES_GMT_H
Loading