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

@ -20,10 +20,21 @@
*/ */
#undef WOLFSSL_ESPIDF #undef WOLFSSL_ESPIDF
#define WOLFSSL_ESPIDF #define WOLFSSL_ESPIDF
/*
* choose ONE of these Espressif chips to define:
*
* WOLFSSL_ESPWROOM32
* WOLFSSL_ESPWROOM32SE
* WOLFSSL_ESP8266
*
* comment out the others:
*/
#define WOLFSSL_ESPWROOM32 #define WOLFSSL_ESPWROOM32
/* Uncomment next line if using Espressif ESP32-WROOM-32SE */
/* comment the above line #define WOLFSSL_ESPWROOM32 */
/* #define WOLFSSL_ESPWROOM32SE */ /* #define WOLFSSL_ESPWROOM32SE */
/* #define WOLFSSL_ESP8266 */
#define BENCH_EMBEDDED #define BENCH_EMBEDDED
#define USE_CERT_BUFFERS_2048 #define USE_CERT_BUFFERS_2048

View File

@ -2457,7 +2457,33 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
} }
#elif defined(WOLFSSL_ESPIDF) #elif defined(WOLFSSL_ESPIDF)
/* Espressif */
#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) #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> #include <esp_system.h>
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)

View File

@ -19,6 +19,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/ */
/*
* ************************************************************************
*
* ******************************** NOTICE ********************************
*
* ************************************************************************
*
* This method of uncommenting a line in settings.h is outdated.
*
* Please use user_settings.h / WOLFSSL_USER_SETTINGS
*
* or
*
* ./configure CFLAGS="-DFLAG"
*
* For more information see:
*
* https://www.wolfssl.com/how-do-i-manage-the-build-configuration-of-wolfssl/
*
*/
/* Place OS specific preprocessor flags, defines, includes here, will be /* Place OS specific preprocessor flags, defines, includes here, will be
included into every file because types.h includes it */ included into every file because types.h includes it */
@ -194,6 +215,11 @@
/* Uncomment next line if building for using Apache mynewt */ /* Uncomment next line if building for using Apache mynewt */
/* #define WOLFSSL_APACHE_MYNEWT */ /* #define WOLFSSL_APACHE_MYNEWT */
/* For Espressif chips see example user_settings.h
*
* https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/user_settings.h
*/
/* Uncomment next line if building for using ESP-IDF */ /* Uncomment next line if building for using ESP-IDF */
/* #define WOLFSSL_ESPIDF */ /* #define WOLFSSL_ESPIDF */