Removed my _time() implementation to use newlib provided one.
This commit is contained in:
parent
f4a5675854
commit
11c9031d9b
3 changed files with 1 additions and 15 deletions
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
/* Add extras/sntp component to makefile for this include to work */
|
/* Add extras/sntp component to makefile for this include to work */
|
||||||
#include <sntp.h>
|
#include <sntp.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#define SNTP_SERVERS "0.pool.ntp.org", "1.pool.ntp.org", \
|
#define SNTP_SERVERS "0.pool.ntp.org", "1.pool.ntp.org", \
|
||||||
"2.pool.ntp.org", "3.pool.ntp.org"
|
"2.pool.ntp.org", "3.pool.ntp.org"
|
||||||
|
|
|
@ -47,12 +47,6 @@ void sntp_initialize(const struct timezone *tz);
|
||||||
*/
|
*/
|
||||||
void sntp_set_timezone(const struct timezone *tz);
|
void sntp_set_timezone(const struct timezone *tz);
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns the time in seconds since Epoch. If tloc is not NULL, return
|
|
||||||
* value is also stored in the memory pointed by tloc.
|
|
||||||
*/
|
|
||||||
time_t time(time_t *tloc);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set SNTP servers. Up to SNTP_NUM_SERVERS_SUPPORTED can be set.
|
* Set SNTP servers. Up to SNTP_NUM_SERVERS_SUPPORTED can be set.
|
||||||
* Returns 0 if OK, less than 0 if error.
|
* Returns 0 if OK, less than 0 if error.
|
||||||
|
|
|
@ -95,15 +95,6 @@ int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Added te get nearer the standard way of using time functions.
|
|
||||||
time_t time(time_t *tloc) {
|
|
||||||
time_t datetime;
|
|
||||||
|
|
||||||
datetime = sntp_get_rtc_time(NULL);
|
|
||||||
if (tloc) *tloc = datetime;
|
|
||||||
return datetime;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update RTC timer. Called by SNTP module each time it receives an update.
|
// Update RTC timer. Called by SNTP module each time it receives an update.
|
||||||
void sntp_update_rtc(time_t t, uint32_t us) {
|
void sntp_update_rtc(time_t t, uint32_t us) {
|
||||||
// Apply daylight and timezone correction
|
// Apply daylight and timezone correction
|
||||||
|
|
Loading…
Reference in a new issue