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.

33 lines
755 B

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