ntp.h 388 Bytes
Newer Older
1
2
3
4
#ifndef AMPEL_TIME_H_INCLUDED
#define AMPEL_TIME_H_INCLUDED

namespace ntp {
Eric Duminil's avatar
Eric Duminil committed
5
  extern bool connected_at_least_once;
6
  void initialize();
Eric Duminil's avatar
Eric Duminil committed
7
  void connect();
8
9
10
11
12
13
14
15
  void update();
  void getLocalTime(char *timestamp);
}

//NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over.
#define seconds() (millis() / 1000UL)

#endif