Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32S2 support #127

Merged
merged 2 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions components/ds1302/ds1302.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#if HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32_V4
#include <esp32/rom/ets_sys.h>
#elif HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32S2_V4
#include <esp32s2/rom/ets_sys.h>
#else
#include <rom/ets_sys.h>
#endif
Expand Down
12 changes: 9 additions & 3 deletions components/esp_idf_lib_helpers/esp_idf_lib_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <freertos/FreeRTOS.h>

/* {{{ 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
/* }}} */

Expand All @@ -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)
Expand All @@ -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 */
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions components/hd44780/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#if HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32_V4
#include <esp32/rom/ets_sys.h>
#elif HELPER_TARGET_VERSION == HELPER_TARGET_VERSION_ESP32S2_V4
#include <esp32s2/rom/ets_sys.h>
#else
#include <rom/ets_sys.h>
#endif
Expand Down