Skip to content

Commit 5c53b7c

Browse files
committed
os_xtensa: revert to its original state
created a new file port instead Signed-off-by: Sylvio Alves <[email protected]>
1 parent 0e01c72 commit 5c53b7c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

components/wpa_supplicant/port/os_xtensa.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,28 @@
2424

2525
#include "os.h"
2626
#include <stdlib.h>
27-
#include <posix/time.h>
28-
#include <posix/sys/time.h>
27+
#include <time.h>
28+
#include <sys/time.h>
2929
#include "esp_system.h"
3030
#include "utils/common.h"
31-
#include <random/rand32.h>
32-
3331

3432
int os_get_time(struct os_time *t)
3533
{
36-
return gettimeofday((struct timeval*) t, NULL);
34+
struct timeval tv;
35+
int ret = gettimeofday(&tv, NULL);
36+
t->sec = (os_time_t) tv.tv_sec;
37+
t->usec = tv.tv_usec;
38+
return ret;
3739
}
3840

3941
unsigned long os_random(void)
4042
{
41-
return sys_rand32_get();
43+
return esp_random();
4244
}
4345

4446
int os_get_random(unsigned char *buf, size_t len)
4547
{
46-
sys_rand_get((void *)buf, len);
48+
esp_fill_random(buf, len);
4749
return 0;
4850
}
4951

0 commit comments

Comments
 (0)