Merge pull request #5077 from gojimmypi/ESP8266_Development

Add ESP-IDF WOLFSSL_ESP8266 setting for ESP8266 devices
This commit is contained in:
David Garske
2022-05-25 12:46:10 -07:00
committed by GitHub
3 changed files with 65 additions and 2 deletions

View File

@@ -2457,7 +2457,33 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
}
#elif defined(WOLFSSL_ESPIDF)
/* Espressif */
#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE)
/* Espressif ESP32 */
#include <esp_system.h>
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
word32 rand;
while (sz > 0) {
word32 len = sizeof(rand);
if (sz < len)
len = sz;
/* Get one random 32-bit word from hw RNG */
rand = esp_random( );
XMEMCPY(output, &rand, len);
output += len;
sz -= len;
}
return 0;
}
#elif defined(WOLFSSL_ESP8266)
/* Espressif ESP8266 */
#include <esp_system.h>
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)