Removed my _time() implementation to use newlib provided one.

This commit is contained in:
doragasu 2016-03-31 16:05:15 +02:00
parent f4a5675854
commit 11c9031d9b
3 changed files with 1 additions and 15 deletions

View file

@ -22,6 +22,7 @@
/* Add extras/sntp component to makefile for this include to work */
#include <sntp.h>
#include <time.h>
#define SNTP_SERVERS "0.pool.ntp.org", "1.pool.ntp.org", \
"2.pool.ntp.org", "3.pool.ntp.org"

View file

@ -47,12 +47,6 @@ void sntp_initialize(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.
* Returns 0 if OK, less than 0 if error.

View file

@ -95,15 +95,6 @@ int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
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.
void sntp_update_rtc(time_t t, uint32_t us) {
// Apply daylight and timezone correction