-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1642 from mcspr/ntp/async-state
Update NTP
- Loading branch information
Showing
2 changed files
with
141 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ----------------------------------------------------------------------------- | ||
// NtpClient overrides to avoid triggering network sync | ||
// ----------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include <WiFiUdp.h> | ||
#include <NtpClientLib.h> | ||
|
||
class NTPClientWrap : public NTPClient { | ||
|
||
public: | ||
|
||
NTPClientWrap() : NTPClient() { | ||
udp = new WiFiUDP(); | ||
_lastSyncd = 0; | ||
} | ||
|
||
bool setInterval(int shortInterval, int longInterval) { | ||
_shortInterval = shortInterval; | ||
_longInterval = longInterval; | ||
return true; | ||
} | ||
|
||
}; | ||
|
||
// NOTE: original NTP should be discarded by the linker | ||
// TODO: allow NTP client object to be destroyed | ||
NTPClientWrap NTPw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e037dd1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please replace brackets to quotations
in code/espurna/ntp.ino
from
to
with brackets I can't compile on win10
I get error "#include <libs/NtpClientWrap.h> not found"
e037dd1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1677 <-