Compare commits
2 Commits
f8ee536829
...
7e8a6b0dad
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e8a6b0dad | |||
| a897b7d9be |
Submodule ds3231/ds3231 updated: 1388412d70...2a90cdee18
@@ -64,28 +64,6 @@ static inline void printLocalTime(const rtc::DateTime &dateTime)
|
|||||||
serial << dateTime << (dst ? F(" +2") : F(" +1")) << F("\r\n");
|
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)
|
static inline size_t receiveLine(char *buffer, const size_t maxLength)
|
||||||
{
|
{
|
||||||
uart_t serial;
|
uart_t serial;
|
||||||
@@ -148,6 +126,13 @@ int main()
|
|||||||
{
|
{
|
||||||
uart_t serial;
|
uart_t serial;
|
||||||
rtc::DS3231<i2c::Hardware<100'000>, false> ds3231;
|
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();
|
ds3231.init();
|
||||||
serial.init();
|
serial.init();
|
||||||
|
|||||||
Reference in New Issue
Block a user