-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03ccd2b
commit 79cf50a
Showing
12 changed files
with
134 additions
and
15 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
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
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,33 @@ | ||
#include <NTPClient.h> | ||
#include <WiFiUdp.h> | ||
#include "configuration.h" | ||
#include "ntp_utils.h" | ||
#include "time.h" | ||
|
||
|
||
extern Configuration Config; | ||
|
||
WiFiUDP ntpUDP; | ||
NTPClient timeClient(ntpUDP, "pool.ntp.org", 0, 15 * 60 * 1000); // Update interval 15 min | ||
|
||
|
||
namespace NTP_Utils { | ||
|
||
void setup() { | ||
if (!Config.digi.ecoMode && Config.callsign != "NOCALL-10") { | ||
int gmt = Config.ntp.gmtCorrection * 3600; | ||
timeClient.setTimeOffset(gmt); | ||
timeClient.begin(); | ||
} | ||
} | ||
|
||
void update() { | ||
if (!Config.digi.ecoMode && Config.callsign != "NOCALL-10") timeClient.update(); | ||
} | ||
|
||
String getFormatedTime() { | ||
if (!Config.digi.ecoMode) return timeClient.getFormattedTime(); | ||
return "DigiEcoMode Active"; | ||
} | ||
|
||
} |
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,14 @@ | ||
#ifndef NTP_UTILS_H_ | ||
#define NTP_UTILS_H_ | ||
|
||
#include <Arduino.h> | ||
|
||
namespace NTP_Utils { | ||
|
||
void setup(); | ||
void update(); | ||
String getFormatedTime(); | ||
|
||
} | ||
|
||
#endif |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
class ReceivedPacket { | ||
public: | ||
long millis; | ||
String rxTime; | ||
String packet; | ||
int RSSI; | ||
float SNR; | ||
|
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