time_util.h 331 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef AMPEL_TIME_H_INCLUDED
#define AMPEL_TIME_H_INCLUDED

namespace ntp {
  void initialize();
  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