Skip to content

Commit

Permalink
Some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
gmag11 committed May 1, 2017
1 parent 41560eb commit c538062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/NTPClientESP8266/WifiConfig.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#ifndef WIFI_CONFIG_H
#define WIFI_CONFIG_H

#pragma once
#ifndef WIFI_CONFIG_H
#define WIFI_CONFIG_H

#define YOUR_WIFI_SSID "YOUR_WIFI_SSID"
#define YOUR_WIFI_PASSWD "YOUR_WIFI_PASSWD"

Expand Down
4 changes: 2 additions & 2 deletions src/ESPNTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ time_t NTPClient::getTime()
if (WiFi.isConnected()) {
DEBUGLOG("-- Transmit NTP Request\r\n");
uint32 secsSince1970 = sntp_get_current_timestamp();
NTP.getUptime();
NTP.getUptime(); // Keep uptime updated to avoid overflow if not called
if (secsSince1970) {
setSyncInterval(NTP.getInterval()); // Normal refresh frequency
DEBUGLOG("Sync frequency set low\r\n");
if (getDayLight()) {
if (_daylight) {
if (summertime(year(secsSince1970), month(secsSince1970), day(secsSince1970), hour(secsSince1970), getTimeZone())) {
secsSince1970 += SECS_PER_HOUR;
DEBUGLOG("Summer Time\r\n");
Expand Down

0 comments on commit c538062

Please sign in to comment.