test(sd): added .cpp build test

This commit is contained in:
Armando 2024-08-16 15:12:34 +08:00
parent af4315a2b1
commit 2133ca9522
3 changed files with 35 additions and 2 deletions

View File

@ -129,7 +129,7 @@ typedef struct {
#if SOC_SPI_AS_CS_SUPPORTED
uint32_t as_cs : 1; ///< Whether to toggle the CS while the clock toggles, device specific
#endif
uint32_t positive_cs : 1; ///< Whether the positive CS feature is abled, device specific
uint32_t positive_cs : 1; ///< Whether the positive CS feature is enabled, device specific
};//boolean configurations
} spi_hal_dev_config_t;

View File

@ -1,6 +1,7 @@
set(srcs cxx_build_test_main.cpp
test_soc_reg_macros.cpp
test_cxx_standard.cpp)
test_cxx_standard.cpp
test_sdmmc_sdspi_init.cpp)
if(CONFIG_SOC_I2C_SUPPORTED)
list(APPEND srcs test_i2c_lcd.cpp)

View File

@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "soc/soc_caps.h"
#if SOC_SDMMC_HOST_SUPPORTED
#include "driver/sdmmc_host.h"
#endif
#include "driver/sdspi_host.h"
/**
* Check that C-style designated initializers are valid in C++ file.
*/
static void test_initializers() __attribute__((unused));
static void test_initializers()
{
#if SOC_SDMMC_HOST_SUPPORTED
sdmmc_host_t sdmmc_host = SDMMC_HOST_DEFAULT();
(void) sdmmc_host;
sdmmc_slot_config_t sdmmc_slot = SDMMC_SLOT_CONFIG_DEFAULT();
(void) sdmmc_slot;
#endif
sdmmc_host_t sdspi_host = SDSPI_HOST_DEFAULT();
(void) sdspi_host;
sdspi_device_config_t sdspi_dev = SDSPI_DEVICE_CONFIG_DEFAULT();
(void) sdspi_dev;
}