-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NTP: use sntp app from lwip on latest Cores, replace ntpclientlib #2132
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
705ff03
ntp: try using sntp app from lwip, drop ntpclientlib
mcspr 61c95b3
fix display
mcspr 96ca127
thermostat: fix day and month getters
mcspr 75a7b50
test build sizes with scheduler
mcspr 448b6c8
use system timers for once-a-minute scheduling, no polling
mcspr 9730ff7
tick
mcspr bef1ede
avoid timestamps, use tm
mcspr bba1e89
drop utc rpn operator, add utc_hour and utc_dow
mcspr 71a878f
try to build with old implementation too
mcspr bec4610
dep
mcspr 184c9c2
notify ws
mcspr 746bfa1
progmem
mcspr 038bb8d
cleanup types
mcspr 5230740
offset tm values by 1 to match existing schedules
mcspr 12f377e
avoid using ntpclientlib with rpn
mcspr ae3868a
test. show debug strings in sch
mcspr e231140
fix secureclient
mcspr 15bb607
consts, fix unsyncing when changing tz (and not triggering sntp after…
mcspr f33178d
startup time in seconds
mcspr 9927ff9
same delay as lwip
mcspr 7e71beb
header
mcspr 3d72e09
assume build timestamp is unixtime
mcspr e7db20f
cache server value
mcspr 3f04c8e
fmt
mcspr bd1b658
typo
mcspr ae5e639
handle dhcp request
mcspr 8c63206
rename
mcspr 416ce01
web
mcspr 7811b83
TZ.h
mcspr 0790d51
add notice about what alias means
mcspr d3aa295
fix disabling NTP_SUPPORT
mcspr 1d3876d
scheduled ticker
mcspr 4732fda
Merge branch 'dev' into ntp/sntp-lwip
mcspr bc8d384
same behaviour as old module
mcspr 68be7c0
rollback rpn dependency check, utc_ prefixes
mcspr c4c45c8
...
mcspr 6f6bfe4
comments, refactor naming
mcspr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
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
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,52 @@ | ||
/* | ||
|
||
NTP MODULE | ||
|
||
*/ | ||
|
||
#pragma once | ||
|
||
#include "broker.h" | ||
|
||
// TODO: need this prototype for .ino | ||
struct NtpCalendarWeekday; | ||
|
||
#if NTP_SUPPORT | ||
|
||
#if NTP_LEGACY_SUPPORT // Use legacy TimeLib and NtpClientLib | ||
|
||
#include <TimeLib.h> | ||
#include "libs/NtpClientWrap.h" | ||
|
||
#else // POSIX time functions + configTime(...) | ||
|
||
#include <lwip/apps/sntp.h> | ||
#include <TZ.h> | ||
#include "ntp_timelib.h" | ||
|
||
#endif | ||
|
||
// --- rest of the module is ESPurna functions | ||
|
||
enum class NtpTick { | ||
EveryMinute, | ||
EveryHour | ||
}; | ||
|
||
struct NtpCalendarWeekday { | ||
int local_wday; | ||
int local_hour; | ||
int local_minute; | ||
int utc_wday; | ||
int utc_hour; | ||
int utc_minute; | ||
}; | ||
|
||
using NtpBroker = TBroker<TBrokerType::DATETIME, const NtpTick, time_t, const String&>; | ||
|
||
String ntpDateTime(time_t ts); | ||
String ntpDateTime(); | ||
|
||
void ntpSetup(); | ||
|
||
#endif // NTP_SUPPORT |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
BTW some benefit of having
#if
guards in headers is that compilation will fail instead of linker when function is not implemented / supported