diff --git a/components/hal/linker.lf b/components/hal/linker.lf index 9b23d5a562..c8178e04eb 100644 --- a/components/hal/linker.lf +++ b/components/hal/linker.lf @@ -30,7 +30,8 @@ entries: lcd_hal: lcd_hal_cal_pclk_freq (noflash) if ADC_ONESHOT_CTRL_FUNC_IN_IRAM = y: adc_oneshot_hal (noflash) - adc_hal_common: get_controller (noflash) + if COMPILER_OPTIMIZATION_DEFAULT = y: + adc_hal_common: get_controller (noflash) adc_hal_common: adc_hal_set_controller (noflash) if SOC_ADC_ARBITER_SUPPORTED = y: adc_hal_common: adc_hal_arbiter_config (noflash) @@ -40,7 +41,8 @@ entries: if ADC_CONTINUOUS_ISR_IRAM_SAFE = y: adc_hal: adc_hal_get_reading_result (noflash) adc_hal: adc_hal_digi_start (noflash) - adc_hal: adc_hal_digi_dma_link_descriptors (noflash) + if COMPILER_OPTIMIZATION_DEFAULT = y: + adc_hal: adc_hal_digi_dma_link_descriptors (noflash) adc_hal: adc_hal_digi_stop (noflash) if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S2 = y: adc_hal: adc_hal_check_event (noflash)