From a8c475014931b0851e7b00c454cd069a120f678e Mon Sep 17 00:00:00 2001 From: Mark Buckaway Date: Fri, 23 Oct 2020 09:20:39 -0400 Subject: [PATCH 1/2] ESP32S2 support --- components/ds1302/ds1302.c | 2 ++ components/esp_idf_lib_helpers/esp_idf_lib_helpers.h | 12 +++++++++--- components/hd44780/hd44780.c | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/components/ds1302/ds1302.c b/components/ds1302/ds1302.c index a0156932..ac459268 100644 --- a/components/ds1302/ds1302.c +++ b/components/ds1302/ds1302.c @@ -17,6 +17,8 @@ #if HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32_V4 #include +#elif HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32S2_V4 +#include #else #include #endif diff --git a/components/esp_idf_lib_helpers/esp_idf_lib_helpers.h b/components/esp_idf_lib_helpers/esp_idf_lib_helpers.h index f54b0408..dc77e9f1 100644 --- a/components/esp_idf_lib_helpers/esp_idf_lib_helpers.h +++ b/components/esp_idf_lib_helpers/esp_idf_lib_helpers.h @@ -12,8 +12,8 @@ #include /* {{{ pre-tests */ -#if defined(CONFIG_IDF_TARGET_ESP32) && defined(CONFIG_IDF_TARGET_ESP8266) -#error BUG: defined(CONFIG_IDF_TARGET_ESP32) && defined(CONFIG_IDF_TARGET_ESP8266) +#if defined(CONFIG_IDF_TARGET_ESP32) && defined(CONFIG_IDF_TARGET_ESP8266) && defined(CONFIG_IDF_TARGET_ESP32S2) +#error BUG: defined(CONFIG_IDF_TARGET_ESP32) && defined(CONFIG_IDF_TARGET_ESP8266) && defined(CONFIG_IDF_TARGET_ESP32S #endif /* }}} */ @@ -23,6 +23,7 @@ #define HELPER_TARGET_VERSION_ESP32_V3_2 (32030200) #define HELPER_TARGET_VERSION_ESP32_V3_3 (32030300) #define HELPER_TARGET_VERSION_ESP32_V4 (32040000) +#define HELPER_TARGET_VERSION_ESP32S2_V4 (32042000) #define HELPER_TARGET_VERSION_ESP32_V_MAX (32999999) #define HELPER_TARGET_VERSION_ESP8266_V0 (8266000000) #define HELPER_TARGET_VERSION_ESP8266_V3_2 (8266030200) @@ -35,8 +36,12 @@ * branch code flow. */ +/* ESP32S2 4.x */ +#if defined(CONFIG_IDF_TARGET_ESP32S2) && defined(ESP_IDF_VERSION_MAJOR) +#define HELPER_TARGET_VERSION HELPER_TARGET_VERSION_ESP32S2_V4 + /* ESP32 4.x */ -#if defined(CONFIG_IDF_TARGET_ESP32) && defined(ESP_IDF_VERSION_MAJOR) +#elif defined(CONFIG_IDF_TARGET_ESP32) && defined(ESP_IDF_VERSION_MAJOR) #define HELPER_TARGET_VERSION HELPER_TARGET_VERSION_ESP32_V4 /* ESP8266 RTOS SDK 3.2 */ @@ -109,6 +114,7 @@ #define VALUE_TO_STRING(x) #x #define VALUE(x) VALUE_TO_STRING(x) #define VAR_NAME_VALUE(var) #var "=" VALUE(var) +#pragma message(VAR_NAME_VALUE(CONFIG_IDF_TARGET_ESP32S2)) #pragma message(VAR_NAME_VALUE(CONFIG_IDF_TARGET_ESP32)) #pragma message(VAR_NAME_VALUE(CONFIG_IDF_TARGET_ESP8266)) #pragma message(VAR_NAME_VALUE(HELPER_TARGET_VERSION)) diff --git a/components/hd44780/hd44780.c b/components/hd44780/hd44780.c index d334cb84..3fd5151a 100644 --- a/components/hd44780/hd44780.c +++ b/components/hd44780/hd44780.c @@ -16,6 +16,8 @@ #if HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32_V4 #include +#elif HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32S2_V4 +#include #else #include #endif From 119ada3d24c1c29f52b8e89e304f9b44856fb857 Mon Sep 17 00:00:00 2001 From: Mark Buckaway Date: Fri, 23 Oct 2020 09:24:50 -0400 Subject: [PATCH 2/2] Updated readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2e674429..3797c64d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ Most of them ported from [esp-open-rtos](https://github.com/SuperHouse/esp-open- * 4.x * 3.2.2 +### ESP32 Chip Support + + * ESP32 + * ESP32S2 + +Use "idf.py set-target esp32s2" before "idf.py menuconfig" to change the chip type. + ### ESP8266 RTOS SDK * master