ESP -IDF adc_dma读取多个通道值,一直编译不过

yuanjie
Posts: 20
Joined: Wed Dec 22, 2021 3:26 pm

ESP -IDF adc_dma读取多个通道值,一直编译不过

Postby yuanjie » Wed May 04, 2022 3:13 pm

ret = adc_digi_controller_config(&dig_cfg);
^~~~~~~~~~~~~~~~~~~~~~~~~~
../main/adc_dma_example_main.c: At top level:
../main/adc_dma_example_main.c:47:36: error: unknown type name 'adc_digi_output_data_t'
static bool check_valid_data(const adc_digi_output_data_t *data)
^~~~~~~~~~~~~~~~~~~~~~
../main/adc_dma_example_main.c: In function 'check_valid_data':
../main/adc_dma_example_main.c:49:35: error: request for member 'type2' in something not a structure or union
const unsigned int unit = data->type2.unit;
^~
../main/adc_dma_example_main.c:51:13: error: request for member 'type2' in something not a structure or union
if (data->type2.channel >= SOC_ADC_CHANNEL_NUM(unit)) return false;
^~
../main/adc_dma_example_main.c: In function 'continuous_read':
../main/adc_dma_example_main.c:68:5: error: implicit declaration of function 'adc_digi_start' [-Werror=implicit-function-declaration]
adc_digi_start();
^~~~~~~~~~~~~~
../main/adc_dma_example_main.c:72:15: error: implicit declaration of function 'adc_digi_read_bytes' [-Werror=implicit-function-declaration]
ret = adc_digi_read_bytes(result, TIMES, &ret_num, ADC_MAX_DELAY);
^~~~~~~~~~~~~~~~~~~
../main/adc_dma_example_main.c:72:60: error: 'ADC_MAX_DELAY' undeclared (first use in this function); did you mean 'portMAX_DELAY'?
ret = adc_digi_read_bytes(result, TIMES, &ret_num, ADC_MAX_DELAY);
^~~~~~~~~~~~~
portMAX_DELAY
../main/adc_dma_example_main.c:72:60: note: each undeclared identifier is reported only once for each function it appears in
../main/adc_dma_example_main.c:74:13: error: unknown type name 'adc_digi_output_data_t'
adc_digi_output_data_t *p = (void*)&result;
^~~~~~~~~~~~~~~~~~~~~~
../main/adc_dma_example_main.c:76:45: error: request for member 'type2' in something not a structure or union
printf("ADC%d_CH%d: %x\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:76:62: error: request for member 'type2' in something not a structure or union
printf("ADC%d_CH%d: %x\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:76:80: error: request for member 'type2' in something not a structure or union
printf("ADC%d_CH%d: %x\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:78:54: error: request for member 'type2' in something not a structure or union
printf("Invalid data [%d_%d_%x]\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:78:71: error: request for member 'type2' in something not a structure or union
printf("Invalid data [%d_%d_%x]\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:78:89: error: request for member 'type2' in something not a structure or union
printf("Invalid data [%d_%d_%x]\n", p->type2.unit+1, p->type2.channel, p->type2.data);
^~
../main/adc_dma_example_main.c:84:5: error: implicit declaration of function 'adc_digi_stop'; did you mean 'esp_timer_stop'? [-Werror=implicit-function-declaration]
adc_digi_stop();
^~~~~~~~~~~~~
esp_timer_stop
../main/adc_dma_example_main.c:85:11: error: implicit declaration of function 'adc_digi_deinitialize' [-Werror=implicit-function-declaration]
ret = adc_digi_deinitialize();
^~~~~~~~~~~~~~~~~~~~~
../main/adc_dma_example_main.c: In function 'single_read':
../main/adc_dma_example_main.c:97:23: error: 'ADC_WIDTH_BIT_DEFAULT' undeclared (first use in this function); did you mean 'ADC_WIDTH_BIT_12'?
adc1_config_width(ADC_WIDTH_BIT_DEFAULT);
^~~~~~~~~~~~~~~~~~~~~
ADC_WIDTH_BIT_12
cc1: some warnings being treated as errors
[849/902] Linking CXX static library esp-idf/wpa_supplicant/libwpa_supplicant.a
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

ESP_Yake
Posts: 109
Joined: Mon Mar 06, 2017 12:23 pm

Re: ESP -IDF adc_dma读取多个通道值,一直编译不过

Postby ESP_Yake » Mon May 09, 2022 12:00 pm

使用的是 ESP32 还是其他芯片?你当前的 IDF commit是多少,编译 hello_world 程序有问题么?

Who is online

Users browsing this forum: No registered users and 41 guests