feat(esp8266): add esp_random function

This commit is contained in:
Zhang Jun Hao
2020-05-26 10:27:42 +08:00
parent bec5ca6fe6
commit 7192a85b2d
2 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,13 @@
#include <string.h>
#include <sys/param.h>
#include "esp_system.h"
#include "esp8266/eagle_soc.h"
extern unsigned int adc_rand_noise;
uint32_t esp_random(void)
{
return (adc_rand_noise ^ REG_READ(WDEV_RAND));
}
void esp_fill_random(void *buf, size_t len)
{