Skip to content
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
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of darkBorder has been changed from false to true. This is a behavior change that will affect all existing watch faces and displays. Ensure this change is intentional and documented, as it will alter the visual appearance of the display border for all users upgrading to this version.

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

Copilot uses AI. Check for mistakes.

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

// This file is used to set up GMT based timezones.

// 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),
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "get summer time" should be "to get summer time". The comment should read "If you set TIMEZONES_NON_GMT_OVERRIDE to 1 (as to get summer time and leaps),".

Suggested change
// If you set TIMEZONES_NON_GMT_OVERRIDE to 1 (as for get summer time and leaps),
// If you set TIMEZONES_NON_GMT_OVERRIDE to 1 (as to get summer time and leaps),

Copilot uses AI. Check for mistakes.
// you must provide one location based timezone.
// 0: GMT, 1: Location timezone.

// Visit the link below.
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "Visit the link below" on line 11 does not actually provide a link. Either add the intended URL or remove this comment.

Suggested change
// Visit the link below.

Copilot uses AI. Check for mistakes.

#ifndef TIMEZONES_NON_GMT_OVERRIDE
#define TIMEZONES_NON_GMT_OVERRIDE 0 // 0: GMT, 1: Location timezone.
#endif

#ifndef TIMEZONES_SELECTED
#define TIMEZONES_SELECTED 0 // If above is 0, value is index of array below.
#endif // Etc/GMT0

#define TIMEZONES_LENGTH 28

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


// 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"
};
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Trailing whitespace on line 33. Remove the spaces after the closing brace and semicolon.

Suggested change
};
};

Copilot uses AI. Check for mistakes.


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
};

static long OFFSETS_SEC[] = {
0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 0, -3600, -7200, -10800, -14400, -18000, -21600, -25200, -28800, -32400, -36000, -39600, -43200, -46800, -50400
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OFFSETS_SEC array has incorrect signs for all timezone offsets. In POSIX notation, "Etc/GMT+N" represents a timezone N hours behind UTC (i.e., UTC-N), so it needs a negative offset. Conversely, "Etc/GMT-N" is UTC+N and needs a positive offset. Currently, all the signs are inverted. For example, index 1 is "Etc/GMT+1" (UTC-1) but has offset 3600 when it should be -3600. Index 14 is "Etc/GMT-1" (UTC+1) but has offset -3600 when it should be 3600. All non-zero offset values need their signs flipped.

Suggested change
0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 0, -3600, -7200, -10800, -14400, -18000, -21600, -25200, -28800, -32400, -36000, -39600, -43200, -46800, -50400
0, -3600, -7200, -10800, -14400, -18000, -21600, -25200, -28800, -32400, -36000, -39600, -43200, 0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400

Copilot uses AI. Check for mistakes.
};

static int8_t tzIndex = TIMEZONES_SELECTED;
#endif //TIMEZONES_GMT_H
Loading