Skip to content

Commit

Permalink
smaall bugfix in example with DS3231
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenradball committed Nov 25, 2024
1 parent 1ebe4a8 commit 5878938
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/time_DS3231_RTC/time_DS3231_RTC.ino
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ void setup() {
while (!MESZ::get_timeHasBeenSynchronized()) {
yield();
}
Serial.println("Time successfully synchronized!");
Serial.println("Time successfully syncronized!");

Check failure on line 60 in examples/time_DS3231_RTC/time_DS3231_RTC.ino

View workflow job for this annotation

GitHub Actions / spellcheck

syncronized ==> synchronized
MESZ::set_timeHasBeenSynchronized_false();
auto syncTime_ms = sntp_get_sync_interval();
Serial.printf("\tthe sntp sync interval is set to : %ld ms / %ld s / %ld min / %ld h\n", \
Serial.printf("\tthe sntp sync intervall is set to : %ld ms / %ld s / %ld min / %ld h\n", \

Check failure on line 63 in examples/time_DS3231_RTC/time_DS3231_RTC.ino

View workflow job for this annotation

GitHub Actions / spellcheck

intervall ==> interval
syncTime_ms, syncTime_ms/1000U, syncTime_ms/60000U, syncTime_ms/3600000U);

Serial.printf("\nZeit: %s", uhr.get_asctime());
Expand All @@ -74,15 +74,19 @@ void setup() {
// clock has actual time then dicconnect Wifi
// to prevent from synchronizing
wifi.Wifi_Disconnect();
while(uhr.getSecond()) {
yield();
}
compareTimes();
}

void loop() {
unsigned int ms{millis()};
static unsigned int last_ms {ms};

if (ms - last_ms >= 36000000U) {
if (ms - last_ms >= 3600000U) {
// print time from ESP and Time from DS3231-RTC
last_ms = ms;
compareTimes();
}
}

0 comments on commit 5878938

Please sign in to comment.