feat(bw): do not show time on main view when RTC not set (#5342)

This commit is contained in:
3djc
2024-07-29 20:13:47 +10:00
committed by GitHub
parent bdfb94ae83
commit 7fb3888b93
4 changed files with 17 additions and 3 deletions
+13
View File
@@ -493,3 +493,16 @@ uint8_t rtcAdjust(uint16_t year, uint8_t mon, uint8_t day, uint8_t hour, uint8_t
}
return 0;
}
bool rtcIsValid()
{
struct gtm t;
gettime(&t);
// If year is 2000, rtc circuit aren't working
// No RTC battery or other issue
if (t.tm_year <= 100)
return false;
return true;
}