ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

saruhan
Posts: 12
Joined: Tue Nov 02, 2021 7:42 pm

ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby saruhan » Wed May 17, 2023 6:25 pm

Hi

ESP IDF gives this warnig:

Code: Select all

ADC: legacy driver is deprecated, please migrate to `esp_adc/adc_oneshot.h`
drivers:

Code: Select all

#include "driver/adc.h"   //ADC
#include "esp_adc/adc_oneshot.h"
#include "esp_adc/adc_continuous.h"
#include "esp_adc_cal.h"  //ADC
#include "esp_adc/adc_cali.h"
sketch:

Code: Select all

	   static esp_adc_cal_characteristics_t adc1_chars;
            //uint16_t voltage;
            esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_DEFAULT, 0, &adc1_chars);
            ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_DEFAULT));
            ESP_ERROR_CHECK(adc1_config_channel_atten(ADC1_CHANNEL_6, ADC_ATTEN_DB_11));
            pil_voltaji = esp_adc_cal_raw_to_voltage(adc1_get_raw(ADC1_CHANNEL_6), &adc1_chars);
How can I fix it?

saruhan
Posts: 12
Joined: Tue Nov 02, 2021 7:42 pm

Re: ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby saruhan » Thu May 18, 2023 6:27 am

Or How can i disable all warnings?

ADC_SUPPRESS_DEPRECATE_WARN=y
I applied this set but it doesnt work. Warnings continuous

I changed this in sdkconfig but after build this set returns default value. ı cant set this properties.

ESP_Sprite
Posts: 9716
Joined: Thu Nov 26, 2015 4:08 am

Re: ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby ESP_Sprite » Thu May 18, 2023 8:44 am

You need to use 'idf.py menuconfig' (or the equivalent in your IDE) to set that option.

saruhan
Posts: 12
Joined: Tue Nov 02, 2021 7:42 pm

Re: ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby saruhan » Thu May 18, 2023 11:58 am

thank you for your reply I use VScode so when i type idf.py menuconfig .

it returns fault:
Image

ESP_Sprite
Posts: 9716
Joined: Thu Nov 26, 2015 4:08 am

Re: ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby ESP_Sprite » Fri May 19, 2023 7:57 am

i think vscode has a gear icon in the bottom toolbar that brings up the equivalent of menuconfig.

saruhan
Posts: 12
Joined: Tue Nov 02, 2021 7:42 pm

Re: ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

Postby saruhan » Fri May 19, 2023 11:17 am

ESP_Sprite wrote:
Fri May 19, 2023 7:57 am
i think vscode has a gear icon in the bottom toolbar that brings up the equivalent of menuconfig.
I changed menuconfig but result is same . it still gives warnings.

before:
Image
after:
Image

Result is same:
Image

Who is online

Users browsing this forum: Baidu [Spider] and 242 guests