Skip to content

Commit 25e43ca

Browse files
Merge pull request #1 from crossplatformdev/custom
Custom
2 parents 71457b5 + a9a7169 commit 25e43ca

File tree

7 files changed

+186
-42
lines changed

7 files changed

+186
-42
lines changed

src/Display.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,35 @@ void WatchyDisplay::asyncPowerOn() {
4848
}
4949
}
5050

51-
void WatchyDisplay::setDarkBorder(bool dark) {
51+
void WatchyDisplay::drawDarkBorder(bool dark) {
5252
if (_hibernating) return;
53-
darkBorder = dark;
53+
//This line overrides the intended behaviour that I want for the
54+
//darkBorder variable. I want to set the darkBorder variable to dark
55+
//and then paint the border always dark, not always putting the opposite
56+
//colour of the background, like it is done here.
57+
//darkBorder = dark;
5458
_startTransfer();
5559
_transferCommand(0x3C); // BorderWavefrom
5660
_transfer(dark ? 0x02 : 0x05);
5761
_endTransfer();
5862
}
5963

64+
/*
65+
This is a setter for the darkBorder variable. It sets the darkBorder.
66+
*/
67+
void WatchyDisplay::setDarkBorder(bool dark) {
68+
if (_hibernating) return;
69+
darkBorder = dark;
70+
drawDarkBorder(dark);
71+
}
72+
73+
/*
74+
This is a getter for the darkBorder variable. It returns the darkBorder.
75+
*/
76+
bool WatchyDisplay::isDarkBorder() {
77+
return darkBorder;
78+
}
79+
6080
void WatchyDisplay::clearScreen(uint8_t value)
6181
{
6282
writeScreenBuffer(value);

src/Display.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class WatchyDisplay : public GxEPD2_EPD
3838
// constructor
3939
WatchyDisplay();
4040
void initWatchy();
41+
void drawDarkBorder(bool darkBorder);
4142
void setDarkBorder(bool darkBorder);
43+
bool isDarkBorder();
4244
void asyncPowerOn();
4345
void _PowerOnAsync();
4446
bool waitingPowerOn = false;
@@ -76,7 +78,7 @@ class WatchyDisplay : public GxEPD2_EPD
7678
void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
7779
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
7880

79-
bool darkBorder = false; // adds a dark border outside the normal screen area
81+
bool darkBorder = true; // adds a dark border outside the normal screen area
8082

8183
static constexpr bool reduceBoosterTime = true; // Saves ~200ms
8284
private:

src/TimezonesGMT.h

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#ifndef TIMEZONES_GMT_H
2+
#define TIMEZONES_GMT_H
3+
4+
5+
// You don't need to change anything here to be able to set up GMT based time.
6+
// If you set TIMEZONES_NON_GMT_OVERRIDE to 1 (as for get summer time and leaps),
7+
// you must provide one location based timezone.
8+
// 0: GMT, 1: Location timezone.
9+
10+
// Visit the link below.
11+
12+
#ifndef TIMEZONES_NON_GMT_OVERRIDE
13+
#define TIMEZONES_NON_GMT_OVERRIDE 0
14+
#endif
15+
16+
#define TIMEZONES_LENGTH 28
17+
#define TIMEZONES_SELECTED 0
18+
19+
typedef struct TZ {
20+
const char* location;
21+
const char* timezone;
22+
} TZ;
23+
24+
25+
#ifdef TIMEZONES_NON_GMT_OVERRIDE
26+
// https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
27+
static TZ tz_override = {
28+
"Europe/Madrid",
29+
"CET-1CEST,M3.5.0,M10.5.0/3"
30+
};
31+
#endif
32+
33+
34+
static TZ timeZones[] = {
35+
{"Etc/GMT+0","GMT0"}, // 0
36+
{"Etc/GMT+1","<-01>1"}, // 1
37+
{"Etc/GMT+2","<-02>2"}, // 2
38+
{"Etc/GMT+3","<-03>3"}, // 3
39+
{"Etc/GMT+4","<-04>4"}, // 4
40+
{"Etc/GMT+5","<-05>5"}, // 5
41+
{"Etc/GMT+6","<-06>6"}, // 6
42+
{"Etc/GMT+7","<-07>7"}, // 7
43+
{"Etc/GMT+8","<-08>8"}, // 8
44+
{"Etc/GMT+9","<-09>9"}, // 9
45+
{"Etc/GMT+10","<-10>10"}, // 10
46+
{"Etc/GMT+11","<-11>11"}, // 11
47+
{"Etc/GMT+12","<-12>12"}, // 12
48+
{"Etc/GMT-0","GMT0"}, // 13
49+
{"Etc/GMT-1","<+01>-1"}, // 14
50+
{"Etc/GMT-2","<+02>-2"}, // 15
51+
{"Etc/GMT-3","<+03>-3"}, // 16
52+
{"Etc/GMT-4","<+04>-4"}, // 17
53+
{"Etc/GMT-5","<+05>-5"}, // 18
54+
{"Etc/GMT-6","<+06>-6"}, // 19
55+
{"Etc/GMT-7","<+07>-7"}, // 20
56+
{"Etc/GMT-8","<+08>-8"}, // 21
57+
{"Etc/GMT-9","<+09>-9"}, // 22
58+
{"Etc/GMT-10","<+10>-10"}, // 23
59+
{"Etc/GMT-11","<+11>-11"}, // 24
60+
{"Etc/GMT-12","<+12>-12"}, // 25
61+
{"Etc/GMT-13","<+13>-13"}, // 26
62+
{"Etc/GMT-14","<+14>-14"}, // 27
63+
};
64+
65+
#endif //TIMEZONES_GMT_H

0 commit comments

Comments
 (0)