Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
702 B

  1. // -----------------------------------------------------------------------------
  2. // NtpClient overrides to avoid triggering network sync
  3. // -----------------------------------------------------------------------------
  4. #pragma once
  5. #include <WiFiUdp.h>
  6. #include <NtpClientLib.h>
  7. class NTPClientWrap : public NTPClient {
  8. public:
  9. NTPClientWrap() : NTPClient() {
  10. udp = new WiFiUDP();
  11. _lastSyncd = 0;
  12. }
  13. bool setInterval(int shortInterval, int longInterval) {
  14. _shortInterval = shortInterval;
  15. _longInterval = longInterval;
  16. }
  17. };
  18. // NOTE: original NTP should be discarded by the linker
  19. // TODO: allow NTP client object to be destroyed
  20. NTPClientWrap NTPw;