mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 20:54:24 +00:00
Merge branch 'feature/universal_clang_toolchain_support' into 'master'
build: Adds support for universal Clang toolchain Closes LLVM-79 See merge request espressif/esp-idf!20090
This commit is contained in:
@@ -734,7 +734,11 @@ if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE AND CONFIG_BT_NIMBLE_ENABLED)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
|
||||
set(jump_table_opts "-fjump-tables")
|
||||
if(NOT (CMAKE_C_COMPILER_ID MATCHES "Clang") )
|
||||
set(jump_table_opts "${jump_table_opts} -ftree-switch-conversion")
|
||||
endif()
|
||||
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/host/bluedroid/bta/hf_ag/bta_ag_cmd.c"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/host/bluedroid/btc/profile/std/gap/btc_gap_ble.c"
|
||||
PROPERTIES COMPILE_FLAGS "-fjump-tables -ftree-switch-conversion")
|
||||
PROPERTIES COMPILE_FLAGS "${jump_table_opts}")
|
||||
endif()
|
||||
|
@@ -512,7 +512,7 @@ static xt_handler set_isr_hlevel_wrapper(int mask, xt_handler f, void *arg)
|
||||
static void IRAM_ATTR interrupt_hlevel_disable(void)
|
||||
{
|
||||
assert(xPortGetCoreID() == CONFIG_BTDM_CTRL_PINNED_TO_CORE);
|
||||
assert(hli_cb.nested != ~0);
|
||||
assert(hli_cb.nested != UCHAR_MAX);
|
||||
uint32_t status = hli_intr_disable();
|
||||
if (hli_cb.nested++ == 0) {
|
||||
hli_cb.status = status;
|
||||
|
@@ -550,7 +550,7 @@ esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
|
||||
if((param_type != ESP_BLE_SM_CLEAR_STATIC_PASSKEY) && ( value == NULL || len < sizeof(uint8_t) || len > sizeof(uint32_t))) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
if((param_type == ESP_BLE_SM_SET_STATIC_PASSKEY)) {
|
||||
if(param_type == ESP_BLE_SM_SET_STATIC_PASSKEY) {
|
||||
uint32_t passkey = 0;
|
||||
for(uint8_t i = 0; i < len; i++)
|
||||
{
|
||||
|
@@ -898,14 +898,14 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
}
|
||||
|
||||
/* put device to connectable mode */
|
||||
if (!BTM_SetConnectability(BTM_CONNECTABLE, BTM_DEFAULT_CONN_WINDOW,
|
||||
BTM_DEFAULT_CONN_INTERVAL) == BTM_SUCCESS) {
|
||||
if (BTM_SetConnectability(BTM_CONNECTABLE, BTM_DEFAULT_CONN_WINDOW,
|
||||
BTM_DEFAULT_CONN_INTERVAL) != BTM_SUCCESS) {
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
|
||||
/* put device to discoverable mode */
|
||||
if (!BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE, BTM_DEFAULT_DISC_WINDOW,
|
||||
BTM_DEFAULT_DISC_INTERVAL) == BTM_SUCCESS) {
|
||||
if (BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE, BTM_DEFAULT_DISC_WINDOW,
|
||||
BTM_DEFAULT_DISC_INTERVAL) != BTM_SUCCESS) {
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,13 @@ if(NOT CONFIG_CXX_EXCEPTIONS)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ gcc)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
# libstdc++ depends on C library, so it should appear later in link order.
|
||||
# Otherwise we get undefined references for esp-clang toolchain.
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ c gcc)
|
||||
else()
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ gcc)
|
||||
endif()
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
|
||||
|
||||
# Force libpthread to appear later than libstdc++ in link line since libstdc++ depends on libpthread.
|
||||
@@ -50,7 +56,11 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
|
||||
idf_component_get_property(pthread pthread COMPONENT_LIB)
|
||||
idf_component_get_property(cxx cxx COMPONENT_LIB)
|
||||
add_library(stdcpp_pthread INTERFACE)
|
||||
target_link_libraries(stdcpp_pthread INTERFACE stdc++ $<TARGET_FILE:${pthread}>)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
target_link_libraries(stdcpp_pthread INTERFACE stdc++ c $<TARGET_FILE:${pthread}>)
|
||||
else()
|
||||
target_link_libraries(stdcpp_pthread INTERFACE stdc++ $<TARGET_FILE:${pthread}>)
|
||||
endif()
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdcpp_pthread)
|
||||
add_library(libgcc_cxx INTERFACE)
|
||||
target_link_libraries(libgcc_cxx INTERFACE gcc $<TARGET_FILE:${cxx}>)
|
||||
|
@@ -26,8 +26,8 @@ static size_t s_static_init_max_waiting_count = 0; //!< maximum ever va
|
||||
#endif
|
||||
|
||||
extern "C" int __cxa_guard_acquire(__guard* pg);
|
||||
extern "C" void __cxa_guard_release(__guard* pg);
|
||||
extern "C" void __cxa_guard_abort(__guard* pg);
|
||||
extern "C" void __cxa_guard_release(__guard* pg) throw();
|
||||
extern "C" void __cxa_guard_abort(__guard* pg) throw();
|
||||
extern "C" void __cxa_guard_dummy(void);
|
||||
|
||||
/**
|
||||
@@ -167,7 +167,7 @@ extern "C" int __cxa_guard_acquire(__guard* pg)
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" void __cxa_guard_release(__guard* pg)
|
||||
extern "C" void __cxa_guard_release(__guard* pg) throw()
|
||||
{
|
||||
guard_t* g = reinterpret_cast<guard_t*>(pg);
|
||||
const auto scheduler_started = xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED;
|
||||
@@ -189,7 +189,7 @@ extern "C" void __cxa_guard_release(__guard* pg)
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __cxa_guard_abort(__guard* pg)
|
||||
extern "C" void __cxa_guard_abort(__guard* pg) throw()
|
||||
{
|
||||
guard_t* g = reinterpret_cast<guard_t*>(pg);
|
||||
const auto scheduler_started = xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED;
|
||||
|
@@ -267,8 +267,9 @@ static esp_err_t essl_spi_update_tx_buffer_num(void *arg, uint32_t wait_ms);
|
||||
esp_err_t essl_spi_init_dev(essl_handle_t *out_handle, const essl_spi_config_t *init_config)
|
||||
{
|
||||
ESP_RETURN_ON_FALSE(init_config->spi, ESP_ERR_INVALID_STATE, TAG, "Check SPI initialization first");
|
||||
ESP_RETURN_ON_FALSE(init_config->tx_sync_reg <= (SOC_SPI_MAXIMUM_BUFFER_SIZE - 1) * 4, ESP_ERR_INVALID_ARG, TAG, "GPSPI supports %d-byte-width internal registers", SOC_SPI_MAXIMUM_BUFFER_SIZE);
|
||||
ESP_RETURN_ON_FALSE(init_config->rx_sync_reg <= (SOC_SPI_MAXIMUM_BUFFER_SIZE - 1) * 4, ESP_ERR_INVALID_ARG, TAG, "GPSPI supports %d-byte-width internal registers", SOC_SPI_MAXIMUM_BUFFER_SIZE);
|
||||
// for esp32-s2 SOC_SPI_MAXIMUM_BUFFER_SIZE is 72, so compiler warns that comparisons of 'tx/rx_sync_reg' are always true
|
||||
ESP_RETURN_ON_FALSE((uint32_t)init_config->tx_sync_reg <= (SOC_SPI_MAXIMUM_BUFFER_SIZE - 1) * 4, ESP_ERR_INVALID_ARG, TAG, "GPSPI supports %d-byte-width internal registers", SOC_SPI_MAXIMUM_BUFFER_SIZE);
|
||||
ESP_RETURN_ON_FALSE((uint32_t)init_config->rx_sync_reg <= (SOC_SPI_MAXIMUM_BUFFER_SIZE - 1) * 4, ESP_ERR_INVALID_ARG, TAG, "GPSPI supports %d-byte-width internal registers", SOC_SPI_MAXIMUM_BUFFER_SIZE);
|
||||
ESP_RETURN_ON_FALSE(init_config->tx_sync_reg != init_config->rx_sync_reg, ESP_ERR_INVALID_ARG, TAG, "Should use different word of registers for synchronization");
|
||||
|
||||
essl_spi_context_t *context = calloc(1, sizeof(essl_spi_context_t));
|
||||
|
@@ -102,7 +102,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -148,7 +150,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -131,7 +131,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -177,7 +179,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -116,7 +116,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -162,7 +164,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -116,7 +116,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -162,7 +164,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -116,7 +116,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -162,7 +164,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -116,7 +116,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
uint8_t block_rs[12];
|
||||
efuse_hal_rs_calculate((void *)range_write_addr_blocks[num_block].start, block_rs);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_CHECK_VALUE0_REG, block_rs, sizeof(block_rs));
|
||||
#pragma GCC diagnostic pop
|
||||
@@ -162,7 +164,9 @@ esp_err_t esp_efuse_utility_burn_chip(void)
|
||||
if (!correct_written_data || coding_error_occurred) {
|
||||
ESP_LOGW(TAG, "BLOCK%d: next retry to fix an error [%d/3]...", num_block, repeat_burn_op);
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy((void *)EFUSE_PGM_DATA0_REG, (void *)backup_write_data, sizeof(backup_write_data));
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -261,7 +261,7 @@ static inline void print_cache_err_details(const void *f)
|
||||
static inline void print_memprot_err_details(const void *f)
|
||||
{
|
||||
uint32_t *fault_addr;
|
||||
uint32_t op_type, op_subtype;
|
||||
uint32_t op_type = MEMPROT_OP_INVALID, op_subtype;
|
||||
const char *operation_type;
|
||||
|
||||
mem_type_prot_t mem_type = esp_memprot_get_active_intr_memtype();
|
||||
|
@@ -205,6 +205,17 @@ FORCE_INLINE_ATTR UBaseType_t uxInitialiseStackTLS(UBaseType_t uxStackPointer, u
|
||||
*/
|
||||
static void __attribute__((optimize("O1"), naked)) vPortTaskWrapper(TaskFunction_t pxCode, void *pvParameters)
|
||||
{
|
||||
#ifdef __clang__
|
||||
// clang generates error "error: non-ASM statement in naked function is not supported"
|
||||
// The reason for it is described at
|
||||
// https://stackoverflow.com/questions/47316611/clang-error-non-asm-statement-in-naked-function-is-not-supported.
|
||||
// GCC docs say that there is no guarantee that non-ASM statement in naked function will work:
|
||||
// "Only basic asm statements can safely be included in naked functions (see Basic Asm).
|
||||
// While using extended asm or a mixture of basic asm and C code may appear to work, they cannot be
|
||||
// depended upon to work reliably and are not supported."
|
||||
// TODO: IDF-6347
|
||||
#error CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER not supported yet when building with Clang!
|
||||
#else
|
||||
asm volatile(".cfi_undefined ra\n");
|
||||
extern void __attribute__((noreturn)) panic_abort(const char *details);
|
||||
static char DRAM_ATTR msg[80] = "FreeRTOS: FreeRTOS Task \"\0";
|
||||
@@ -215,6 +226,7 @@ static void __attribute__((optimize("O1"), naked)) vPortTaskWrapper(TaskFunction
|
||||
strcat(msg, pcTaskName);
|
||||
strcat(msg, "\" should not return, Aborting now!");
|
||||
panic_abort(msg);
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER
|
||||
|
||||
|
@@ -268,7 +268,7 @@ int esp_sha_dma(esp_sha_type sha_type, const void *input, uint32_t ilen,
|
||||
}
|
||||
|
||||
ilen -= dma_chunk_len;
|
||||
input += dma_chunk_len;
|
||||
input = (uint8_t *)input + dma_chunk_len;
|
||||
|
||||
// Only append buf to the first operation
|
||||
buf_len = 0;
|
||||
|
@@ -1,3 +1,5 @@
|
||||
set(compile_options "-nostartfiles")
|
||||
|
||||
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
||||
# avoid esp-clang "unused-command-line-argument" warning
|
||||
if(NOT (CMAKE_C_COMPILER_ID MATCHES "Clang") )
|
||||
set(compile_options "-nostartfiles")
|
||||
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
||||
endif()
|
||||
|
@@ -429,7 +429,6 @@ static esp_err_t cis_tuple_func_manfid(const void* p, uint8_t* data, FILE* fp)
|
||||
static esp_err_t cis_tuple_func_end(const void* p, uint8_t* data, FILE* fp)
|
||||
{
|
||||
const cis_tuple_t* tuple = (const cis_tuple_t*)p;
|
||||
data++;
|
||||
fprintf(fp, "TUPLE: %s\n", tuple->name);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
@@ -59,12 +59,14 @@ extern uint32_t IRAM_ATTR bootloader_flash_read_sfdp(uint32_t sfdp_addr, unsigne
|
||||
static esp_err_t spi_flash_hpm_probe_chip_with_cmd(uint32_t flash_id)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
uint32_t gd_sfdp;
|
||||
|
||||
switch (flash_id) {
|
||||
/* The flash listed here should enter the HPM with command 0xA3 */
|
||||
case 0xC84016:
|
||||
case 0xC84017:
|
||||
// Read BYTE4 in SFDP, 0 means C series, 6 means E series
|
||||
uint32_t gd_sfdp = bootloader_flash_read_sfdp(0x4, 1);
|
||||
gd_sfdp = bootloader_flash_read_sfdp(0x4, 1);
|
||||
if (gd_sfdp == 0x0) {
|
||||
break;
|
||||
} else {
|
||||
@@ -125,6 +127,8 @@ static esp_err_t spi_flash_high_performance_check_hpf_bit_5(void)
|
||||
static esp_err_t spi_flash_hpm_probe_chip_with_dummy(uint32_t flash_id)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
uint32_t gd_sfdp;
|
||||
|
||||
switch (flash_id) {
|
||||
/* The flash listed here should enter the HPM by adjusting dummy cycles */
|
||||
// XMC chips.
|
||||
@@ -135,7 +139,7 @@ static esp_err_t spi_flash_hpm_probe_chip_with_dummy(uint32_t flash_id)
|
||||
case 0xC84017:
|
||||
case 0xC84018:
|
||||
// Read BYTE4 in SFDP, 0 means C series, 6 means E series
|
||||
uint32_t gd_sfdp = bootloader_flash_read_sfdp(0x4, 1);
|
||||
gd_sfdp = bootloader_flash_read_sfdp(0x4, 1);
|
||||
if (gd_sfdp == 0x6) {
|
||||
break;
|
||||
} else {
|
||||
|
@@ -608,7 +608,7 @@ esp_err_t te_dev_set_threshold(te_dev_t *device)
|
||||
smo_val = te_read_smooth_signal(device->channel);
|
||||
ret = te_config_thresh(device->channel, device->sens * smo_val);
|
||||
}
|
||||
ESP_LOGD(TE_DEBUG_TAG, "channel: %"PRIu8", smo_val: %"PRIu32, device->channel, smo_val);
|
||||
ESP_LOGD(TE_DEBUG_TAG, "channel: %"PRIu8", smo_val: %"PRIu32, (uint8_t)device->channel, smo_val);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -906,14 +906,14 @@ static bool waterproof_channel_check(touch_pad_t channel_num)
|
||||
if (waterproof_shield_check_state()) {
|
||||
if (channel_num == waterproof_handle->shield_channel) {
|
||||
ESP_LOGE(TE_TAG, "TOUCH_PAD_NUM%"PRIu8" has been used for waterproof shield channel,"
|
||||
" please change the touch sensor channel or disable waterproof", channel_num);
|
||||
" please change the touch sensor channel or disable waterproof", (uint8_t)channel_num);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (waterproof_guard_check_state()) {
|
||||
if (channel_num == waterproof_handle->guard_device->channel) {
|
||||
ESP_LOGE(TE_TAG, "TOUCH_PAD_NUM%"PRIu8" has been used for waterproof guard channel,"
|
||||
" please change the touch sensor channel or disable waterproof", channel_num);
|
||||
" please change the touch sensor channel or disable waterproof", (uint8_t)channel_num);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -1643,7 +1643,7 @@ static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
|
||||
if (wpa_supplicant_send_2_of_2(sm, key, ver, key_info))
|
||||
goto failed;
|
||||
|
||||
if ((WPA_SM_STATE(sm) == WPA_COMPLETED)) {
|
||||
if (WPA_SM_STATE(sm) == WPA_COMPLETED) {
|
||||
#ifdef MSG_PRINT
|
||||
wpa_printf(MSG_DEBUG, "WPA: Group rekeying "
|
||||
"completed with " MACSTR " [GTK=%s]",
|
||||
|
@@ -337,9 +337,16 @@
|
||||
# define XTHAL_GET_INTERRUPT() ({ int __interrupt; \
|
||||
__asm__ __volatile__("rsr.interrupt %0" : "=a"(__interrupt)); \
|
||||
__interrupt; })
|
||||
#ifdef __clang__
|
||||
// TODO: LLVM-195. Currently clang does not support INTSET alias for INTERRUPT special reg
|
||||
# define XTHAL_SET_INTSET(v) do { int __interrupt = (int)(v); \
|
||||
__asm__ __volatile__("wsr.interrupt %0" :: "a"(__interrupt):"memory"); \
|
||||
} while(0)
|
||||
#else
|
||||
# define XTHAL_SET_INTSET(v) do { int __interrupt = (int)(v); \
|
||||
__asm__ __volatile__("wsr.intset %0" :: "a"(__interrupt):"memory"); \
|
||||
} while(0)
|
||||
#endif
|
||||
# define XTHAL_SET_INTCLEAR(v) do { int __interrupt = (int)(v); \
|
||||
__asm__ __volatile__("wsr.intclear %0" :: "a"(__interrupt):"memory"); \
|
||||
} while(0)
|
||||
@@ -433,7 +440,7 @@ static inline unsigned XTHAL_COMPARE_AND_SET( int *addr, int testval, int setva
|
||||
: "=a"(result) : "0" (setval), "a" (testval), "a" (addr)
|
||||
: "memory");
|
||||
#elif XCHAL_HAVE_INTERRUPTS
|
||||
int tmp;
|
||||
int tmp = 0; // clang complains on unitialized var
|
||||
__asm__ __volatile__ (
|
||||
" rsil %4, 15 \n" // %4 == saved ps
|
||||
" l32i %0, %3, 0 \n" // %0 == value to test, return val
|
||||
|
@@ -1,5 +1,20 @@
|
||||
# Check toolchain is configured properly in cmake
|
||||
if(NOT ( ${CMAKE_SYSTEM_NAME} STREQUAL "Generic" AND ${CMAKE_C_COMPILER} MATCHES xtensa))
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
# without '--target' option 'clang -dumpmachine' prints default target arch and it might be not Xtensa
|
||||
# so use `-print-targets` option
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -print-targets
|
||||
OUTPUT_VARIABLE dump_machine
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
|
||||
OUTPUT_VARIABLE dump_machine
|
||||
)
|
||||
endif()
|
||||
message("Compiler supported targets: ${dump_machine}")
|
||||
|
||||
if(NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Generic" AND ${dump_machine} MATCHES xtensa))
|
||||
message(FATAL_ERROR "Internal error, toolchain has not been set correctly by project "
|
||||
"(or an invalid CMakeCache.txt file has been generated somehow)")
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user