Compare commits

...

2 Commits

Author SHA1 Message Date
7e8a6b0dad Add power control for RTC 2020-05-17 15:40:29 +02:00
a897b7d9be Move comparison operator into library 2020-05-17 15:40:15 +02:00
2 changed files with 8 additions and 23 deletions

@ -1 +1 @@
Subproject commit 1388412d70fc9673465d9ae1f115d7696c06d77d
Subproject commit 2a90cdee18579b8897c572f6cd110efbc1c82f02

View File

@ -64,28 +64,6 @@ static inline void printLocalTime(const rtc::DateTime &dateTime)
serial << dateTime << (dst ? F(" +2") : F(" +1")) << F("\r\n");
}
static inline bool operator==(const rtc::DateTime &lhs, const rtc::DateTime &rhs)
{
if (lhs.second != rhs.second)
return false;
if (lhs.minute != rhs.minute)
return false;
if (lhs.hour != rhs.hour)
return false;
if (lhs.day != rhs.day)
return false;
if (lhs.month != rhs.month)
return false;
if (lhs.year != rhs.year)
return false;
return true;
}
static inline bool operator!=(const rtc::DateTime &lhs, const rtc::DateTime &rhs)
{
return !(lhs == rhs);
}
static inline size_t receiveLine(char *buffer, const size_t maxLength)
{
uart_t serial;
@ -148,6 +126,13 @@ int main()
{
uart_t serial;
rtc::DS3231<i2c::Hardware<100'000>, false> ds3231;
io::Pin<io::P::C3> rtcPwr;
rtcPwr = false;
rtcPwr.dir(io::Dir::OUT);
rtcPwr = true;
_delay_ms(1000);
ds3231.init();
serial.init();