diff --git a/components/driver/test/adc_dma_test/test_esp32.c b/components/driver/test/adc_dma_test/test_esp32.c index 67211e407e..0f546390cf 100644 --- a/components/driver/test/adc_dma_test/test_esp32.c +++ b/components/driver/test/adc_dma_test/test_esp32.c @@ -13,11 +13,13 @@ // limitations under the License. /* - Tests for the adc device driver + Tests for the adc device driver on ESP32 only */ +#include "sdkconfig.h" +#if CONFIG_IDF_TARGET_ESP32 + #include "esp_system.h" #include "driver/adc.h" -#include "driver/dac.h" #include "driver/rtc_io.h" #include "driver/gpio.h" #include "unity.h" @@ -28,8 +30,7 @@ #include "nvs_flash.h" #include "test_utils.h" #include "esp_rom_sys.h" - -#if !DISABLED_FOR_TARGETS(ESP8266, ESP32S2, ESP32S3) // This testcase for ESP32 +#include "driver/dac.h" /* * ADC DMA testcase @@ -163,4 +164,4 @@ TEST_CASE("ADC DMA read", "[adc dma]") example_i2s_deinit(); } -#endif // !DISABLED_FOR_TARGETS(ESP8266, ESP32S2) +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/driver/test/adc_dma_test/test_esp32s2.c b/components/driver/test/adc_dma_test/test_esp32s2.c index 8e9f99459c..e129f56c43 100644 --- a/components/driver/test/adc_dma_test/test_esp32s2.c +++ b/components/driver/test/adc_dma_test/test_esp32s2.c @@ -13,8 +13,11 @@ // limitations under the License. /* - Tests for the adc device driver + Tests for the adc device driver on ESP32-S2 only */ +#include "sdkconfig.h" +#if CONFIG_IDF_TARGET_ESP32S2 + #include "esp_system.h" #include "esp_intr_alloc.h" @@ -22,7 +25,6 @@ #include "freertos/task.h" #include "freertos/queue.h" #include "driver/adc.h" -#include "driver/dac.h" #include "driver/rtc_io.h" #include "driver/gpio.h" #include "unity.h" @@ -35,8 +37,7 @@ #include "soc/adc_periph.h" #include "test/test_common_adc.h" #include "esp_rom_sys.h" - -#if !DISABLED_FOR_TARGETS(ESP8266, ESP32, ESP32S3) // This testcase for ESP32S2 +#include "driver/dac.h" #include "soc/system_reg.h" #include "soc/spi_reg.h" @@ -636,4 +637,4 @@ TEST_CASE("test_adc_digi_slope_debug", "[adc_dma][ignore]") } } -#endif // !DISABLED_FOR_TARGETS(ESP8266, ESP32) +#endif // CONFIG_IDF_TARGET_ESP32S2 diff --git a/components/driver/test/dac_dma_test/test_esp32.c b/components/driver/test/dac_dma_test/test_esp32.c index cecf3f4a0e..5c1062bd03 100644 --- a/components/driver/test/dac_dma_test/test_esp32.c +++ b/components/driver/test/dac_dma_test/test_esp32.c @@ -13,14 +13,15 @@ // limitations under the License. /* - Tests for the dac device driver + Tests for the dac device driver on ESP32 only Hardware connection: - ESP32: GPIO25 <---> GPIO26 - - ESP32S2: GPIO17 <---> GPIO18 */ +#include "sdkconfig.h" +#if CONFIG_IDF_TARGET_ESP32 + #include "esp_system.h" #include "driver/adc.h" -#include "driver/dac.h" #include "unity.h" #include "esp_system.h" #include "esp_event.h" @@ -30,8 +31,7 @@ #include "test_utils.h" #include "test_dac_audio_file.h" #include "driver/i2s.h" - -#if !DISABLED_FOR_TARGETS(ESP8266, ESP32S2, ESP32S3) // This testcase for ESP32 +#include "driver/dac.h" /* * DAC DMA config. @@ -166,4 +166,4 @@ TEST_CASE("DAC DMA output", "[dac]") example_i2s_deinit(); } -#endif // !DISABLED_FOR_TARGETS(ESP8266, ESP32S2) +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/driver/test/dac_dma_test/test_esp32s2.c b/components/driver/test/dac_dma_test/test_esp32s2.c index a30297aa4d..958bb3d803 100644 --- a/components/driver/test/dac_dma_test/test_esp32s2.c +++ b/components/driver/test/dac_dma_test/test_esp32s2.c @@ -13,8 +13,10 @@ // limitations under the License. /* - Tests for the dac device driver + Tests for the dac device driver on ESP32-S2 only */ +#include "sdkconfig.h" +#if CONFIG_IDF_TARGET_ESP32S2 #include "esp_system.h" #include "esp_intr_alloc.h" @@ -22,7 +24,6 @@ #include "freertos/task.h" #include "freertos/queue.h" #include "driver/adc.h" -#include "driver/dac.h" #include "driver/rtc_io.h" #include "driver/gpio.h" #include "unity.h" @@ -38,9 +39,7 @@ #include "soc/dac_periph.h" #include "soc/spi_periph.h" #include "test/test_common_adc.h" - -#if !DISABLED_FOR_TARGETS(ESP8266, ESP32, ESP32S3) // This testcase for ESP32S2 - +#include "driver/dac.h" #include "soc/system_reg.h" #include "esp32s2/rom/lldesc.h" #include "test/test_adc_dac_dma.h" @@ -364,4 +363,4 @@ void adc_dac_dma_linker_deinit(void) /** SPI DMA INIT CODE END */ /*******************************************/ -#endif // !DISABLED_FOR_TARGETS(ESP8266, ESP32) +#endif // CONFIG_IDF_TARGET_ESP32S2