Prevent unnecessary refresh in Clock screen.

This commit is contained in:
JF 2020-02-16 18:37:18 +01:00
parent f30573a9b0
commit 79b4f006be
2 changed files with 5 additions and 4 deletions

View File

@ -91,9 +91,10 @@ void Clock::Refresh(bool fullRefresh) {
}
if(fullRefresh || version.IsUpdated()) {
char version[20];
sprintf(version, "VERSION: %d.%d.%d", Version::Major(), Version::Minor(), Version::Patch());
gfx.DrawString(20, 220, 0xffff, version, &smallFont, false);
auto dummy = version.Get();
char versionStr[20];
sprintf(versionStr, "VERSION: %d.%d.%d", Version::Major(), Version::Minor(), Version::Patch());
gfx.DrawString(20, 220, 0xffff, versionStr, &smallFont, false);
}
}

View File

@ -19,7 +19,7 @@ namespace Pinetime {
explicit DirtyValue(T v) { value = v; }
explicit DirtyValue(T& v) { value = v; }
bool IsUpdated() const { return isUpdated; }
T& Get() { return value; this->isUpdated = false;}
T& Get() { this->isUpdated = false; return value;}
DirtyValue& operator=(const T& other) {
this->value = other;