Skip to content

Commit 484d2c5

Browse files
committed
fix(system): fixed issues with unused variable warnings when compiling with NDEBUG
1 parent b46d001 commit 484d2c5

File tree

28 files changed

+43
-5
lines changed

28 files changed

+43
-5
lines changed

components/bt/host/bluedroid/stack/btu/btu_hcif.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,7 @@ static void btu_hcif_command_status_evt_on_task(BT_HDR *event)
17481748
// check the HCI command integrity: opcode
17491749
hci_cmd_metadata_t *metadata = HCI_GET_CMD_METAMSG(hack->command);
17501750
assert(metadata->opcode == opcode);
1751+
(void)metadata;
17511752

17521753
HCI_FREE_CMD_BUF(hack->command);
17531754
osi_free(event);

components/console/esp_console_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ void esp_console_repl_task(void *args)
166166
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
167167

168168
if (repl_com->state_mux != NULL) {
169-
BaseType_t ret_val = xSemaphoreTake(repl_com->state_mux, portMAX_DELAY);
170-
assert(ret_val == pdTRUE);
169+
xSemaphoreTake(repl_com->state_mux, portMAX_DELAY);
171170
}
172171

173172
/* Change standard input and output of the task if the requested UART is

components/console/esp_console_repl_internal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ esp_err_t esp_console_common_deinit(esp_console_repl_com_t *repl_com)
121121
// wait for the task to notify that
122122
// esp_console_repl_task returned
123123
assert(repl_com->state_mux != NULL);
124-
BaseType_t ret_val = xSemaphoreTake(repl_com->state_mux, portMAX_DELAY);
125-
assert(ret_val == pdTRUE);
124+
xSemaphoreTake(repl_com->state_mux, portMAX_DELAY);
126125

127126
// delete the semaphore for the repl state
128127
vSemaphoreDelete(repl_com->state_mux);

components/driver/test_apps/components/test_driver_utils/test_spi_utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void spitest_slave_task(void* arg)
7676
while (1) {
7777
BaseType_t ret = xQueueReceive(queue, &txdata, portMAX_DELAY);
7878
assert(ret);
79+
(void)ret;
7980

8081
spi_slave_transaction_t t = {};
8182
t.length = txdata.len;

components/esp_adc/adc_cali_curve_fitting.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static void get_first_step_reference_point(int version_num, adc_unit_t unit_id,
163163
uint32_t digi = 0;
164164
ret = esp_efuse_rtc_calib_get_cal_voltage(version_num, unit_id, (int)atten, &digi, &voltage);
165165
assert(ret == ESP_OK);
166+
(void)ret;
167+
166168
calib_info->ref_data.ver1.voltage = voltage;
167169
calib_info->ref_data.ver1.digi = digi;
168170
}

components/esp_adc/adc_continuous.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static IRAM_ATTR bool adc_dma_intr(adc_continuous_ctx_t *adc_digi_ctx)
7979
else {
8080
esp_err_t msync_ret = esp_cache_msync((void *)finished_buffer, finished_size, ESP_CACHE_MSYNC_FLAG_DIR_M2C);
8181
assert(msync_ret == ESP_OK);
82+
(void)msync_ret;
8283
}
8384
#endif
8485

@@ -126,6 +127,7 @@ static IRAM_ATTR bool adc_dma_intr(adc_continuous_ctx_t *adc_digi_ctx)
126127
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
127128
esp_err_t msync_ret = esp_cache_msync((void *)(adc_digi_ctx->hal.rx_desc), adc_digi_ctx->adc_desc_size, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_INVALIDATE);
128129
assert(msync_ret == ESP_OK);
130+
(void)msync_ret;
129131
#endif
130132
return need_yield;
131133
}
@@ -337,6 +339,7 @@ esp_err_t adc_continuous_start(adc_continuous_handle_t handle)
337339
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
338340
esp_err_t ret = esp_cache_msync(handle->hal.rx_desc, handle->adc_desc_size, ESP_CACHE_MSYNC_FLAG_DIR_C2M);
339341
assert(ret == ESP_OK);
342+
(void)ret;
340343
#endif
341344

342345
adc_dma_start(handle->adc_dma, handle->hal.rx_desc);

components/esp_adc/esp32s2/adc_cali_line_fitting.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ esp_err_t adc_cali_create_scheme_line_fitting(const adc_cali_line_fitting_config
107107
adc_calib_parsed_info_t efuse_parsed_data = {0};
108108
bool success = prepare_calib_data_for(config->unit_id, config->atten, &efuse_parsed_data);
109109
assert(success);
110+
(void)success;
110111
success = calculate_characterization_coefficients(&efuse_parsed_data, chars);
111112
assert(success);
112113
ESP_LOGD(TAG, "adc%d (atten leven %d) calibration done: A:%" PRId32" B:%" PRId32, config->unit_id, config->atten, chars->coeff_a, chars->coeff_b);

components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ IRAM_ATTR static bool csi_dma_trans_done_callback(dw_gdma_channel_handle_t chan,
369369
if ((ctlr->trans.buffer != ctlr->backup_buffer) || ctlr->bk_buffer_exposed) {
370370
esp_err_t ret = esp_cache_msync((void *)(ctlr->trans.buffer), ctlr->trans.received_size, ESP_CACHE_MSYNC_FLAG_DIR_M2C);
371371
assert(ret == ESP_OK);
372+
(void)ret;
372373
assert(ctlr->cbs.on_trans_finished);
373374
if (ctlr->cbs.on_trans_finished) {
374375
ctlr->trans.received_size = ctlr->fb_size_in_bytes;

components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ static uint32_t IRAM_ATTR esp_cam_ctlr_dvp_get_recved_size(esp_cam_ctlr_dvp_cam_
233233
if (esp_ptr_external_ram(rx_buffer)) {
234234
esp_err_t ret = esp_cache_msync(rx_buffer, recv_buffer_size, ESP_CACHE_MSYNC_FLAG_DIR_M2C);
235235
assert(ret == ESP_OK);
236+
(void)ret;
237+
236238
}
237239

238240
if (ctlr->pic_format_jpeg) {

components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_gdma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ esp_err_t IRAM_ATTR esp_cam_ctlr_dvp_dma_start(esp_cam_ctlr_dvp_dma_t *dma, uint
170170
if (esp_ptr_external_ram(dma->desc)) {
171171
esp_err_t ret = esp_cache_msync(dma->desc, dma->desc_size, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_INVALIDATE);
172172
assert(ret == ESP_OK);
173+
(void)ret;
173174
}
174175

175176
return gdma_start(dma->dma_chan, (intptr_t)dma->desc);

0 commit comments

Comments
 (0)