Skip to content

Commit 2a71889

Browse files
committed
feat(lwip): Remove time function in lwip
time function is already defined in libc. internal: 5b2e52c0
1 parent 46cf8c3 commit 2a71889

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ gwen:
88
wps: 1aafc07
99

1010
gitlab:
11-
lwip: 6ee4a9b3
11+
lwip: 243eb8be
1212
driver: 7bee5263

lib/liblwip.a

10.1 KB
Binary file not shown.

third_party/lwip/apps/time.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,16 @@ bool configTime(int timezone, int daylightOffset, char *server1, char *server2,
8787
return true;
8888
}
8989

90-
time_t time(time_t *t)
91-
{
92-
time_t seconds = sntp_get_current_timestamp();
93-
if (seconds == 0){
94-
micros_set_default_time();
95-
seconds = millis();
96-
}
97-
98-
if (t){
99-
*t = seconds;
100-
}
101-
return seconds;
102-
}
103-
10490
int __attribute__((weak))
10591
_gettimeofday_r(void *ptr, struct timeval *ptimeval, void *ptimezone)
10692
{
10793
if (ptimeval){
108-
ptimeval->tv_sec = time(NULL);
94+
time_t seconds = sntp_get_current_timestamp();
95+
if (seconds == 0){
96+
micros_set_default_time();
97+
seconds = millis();
98+
}
99+
ptimeval->tv_sec = seconds;
109100

110101
ptimeval->tv_usec = 0;
111102
}

0 commit comments

Comments
 (0)