Skip to content

Commit 896809b

Browse files
sylvioalvescarlescufi
authored andcommitted
soc: esp32s2: add _gettimeofday_r workaround
Add reentrant _gettimeofday_ call so that build won't fail. This is only a workaround for now. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 9d4d144 commit 896809b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

soc/xtensa/esp32s2/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ zephyr_sources(
66
loader.c
77
)
88

9+
zephyr_library_sources_ifdef(CONFIG_NEWLIB_LIBC newlib_fix.c)
10+
911
# get code-partition slot0 address
1012
dt_nodelabel(dts_partition_path NODELABEL "slot0_partition")
1113
dt_reg_addr(img_0_off PATH ${dts_partition_path})

soc/xtensa/esp32s2/newlib_fix.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019, Intel Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <toolchain.h>
8+
#include <stdio.h>
9+
#include <stddef.h>
10+
#include <unistd.h>
11+
#include <sys/stat.h>
12+
13+
#include <reent.h>
14+
15+
int __weak _gettimeofday_r(struct _reent *r, struct timeval *__tp, void *__tzp)
16+
{
17+
ARG_UNUSED(r);
18+
ARG_UNUSED(__tp);
19+
ARG_UNUSED(__tzp);
20+
21+
return -1;
22+
}

0 commit comments

Comments
 (0)