Skip to content

Commit

Permalink
[ESP32-Sx/C3] build compatibility of SkyView and WebTop with Core 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed May 30, 2024
1 parent 3af9d3e commit 620611b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
8 changes: 6 additions & 2 deletions software/firmware/source/SkyView/Platform_ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ static void ESP32_WiFiUDP_stopAll()

static void ESP32_Battery_setup()
{
#if !defined(ESP_IDF_VERSION_MAJOR) || ESP_IDF_VERSION_MAJOR < 5
#if defined(CONFIG_IDF_TARGET_ESP32)
calibrate_voltage(settings->adapter == ADAPTER_TTGO_T5S ?
(adc1_channel_t) ADC1_GPIO35_CHANNEL :
Expand All @@ -903,6 +904,9 @@ static void ESP32_Battery_setup()
#else
#error "This ESP32 family build variant is not supported!"
#endif /* CONFIG_IDF_TARGET_ESP32 */
#else
/* TBD */
#endif /* ESP_IDF_VERSION_MAJOR */
}

static float ESP32_Battery_voltage()
Expand All @@ -929,11 +933,11 @@ SoftSPI swSPI(SOC_GPIO_PIN_MOSI_WS,
SOC_GPIO_PIN_MOSI_WS, /* half duplex */
SOC_GPIO_PIN_SCK_WS);

#if defined(CONFIG_IDF_TARGET_ESP32C6)
#if defined(ESP_IDF_VERSION_MAJOR) && ESP_IDF_VERSION_MAJOR>=5
static spinlock_t EPD_ident_mutex;
#else
static portMUX_TYPE EPD_ident_mutex;
#endif /* CONFIG_IDF_TARGET_ESP32C6 */
#endif /* ESP_IDF_VERSION_MAJOR */

static ep_model_id ESP32_EPD_ident()
{
Expand Down
5 changes: 4 additions & 1 deletion software/firmware/source/SkyView/Platform_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
//#define USE_ADAFRUIT_MSC

// Audio
//#define EXCLUDE_AUDIO
#if defined(ESP_IDF_VERSION_MAJOR) && ESP_IDF_VERSION_MAJOR>=5
#define EXCLUDE_AUDIO
#endif /* ESP_IDF_VERSION_MAJOR */

#if !defined(EXCLUDE_AUDIO)
//#define USE_EXT_I2S_DAC
#endif /* EXCLUDE_AUDIO */
Expand Down
12 changes: 12 additions & 0 deletions software/firmware/source/SkyWatch/Platform_ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,11 @@ static void ESP32_reset()
static void ESP32_sleep_ms(int ms)
{
esp_sleep_enable_timer_wakeup(ms * 1000);
#if !defined(ESP_IDF_VERSION_MAJOR) || ESP_IDF_VERSION_MAJOR < 5
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH,ESP_PD_OPTION_ON);
#else
/* TBD */
#endif /* ESP_IDF_VERSION_MAJOR */
esp_light_sleep_start();
}

Expand Down Expand Up @@ -817,11 +821,19 @@ static void ESP32_Battery_setup()

} else if (hw_info.model == SOFTRF_MODEL_WEBTOP_USB) {
#if defined(CONFIG_IDF_TARGET_ESP32S2)
#if !defined(ESP_IDF_VERSION_MAJOR) || ESP_IDF_VERSION_MAJOR < 5
calibrate_voltage((adc1_channel_t) ADC1_GPIO9_CHANNEL);
#else
/* TBD */
#endif /* ESP_IDF_VERSION_MAJOR */
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
} else if (hw_info.model == SOFTRF_MODEL_WEBTOP_SERIAL) {
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
#if !defined(ESP_IDF_VERSION_MAJOR) || ESP_IDF_VERSION_MAJOR < 5
calibrate_voltage((adc1_channel_t) ADC1_GPIO2_CHANNEL);
#else
/* TBD */
#endif /* ESP_IDF_VERSION_MAJOR */
#endif /* CONFIG_IDF_TARGET_ESP32S3 */
}
}
Expand Down

0 comments on commit 620611b

Please sign in to comment.