编译报错does not name a type

gtyxl0
Posts: 2
Joined: Sat Oct 30, 2021 7:37 am

编译报错does not name a type

Postby gtyxl0 » Sat Oct 30, 2021 7:41 am

  1. #include "esp_adc_cal.h"
  2. static esp_adc_cal_characteristics_t *adcChar;
  3. adcChar=(esp_adc_cal_characteristics_t *)calloc(1, sizeof(esp_adc_cal_characteristics_t));
'adcChar' does not name a type
试过很多方法,都不能解决

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: 编译报错does not name a type

Postby ESP_Gargamel » Mon Nov 01, 2021 1:21 am

你具体咋整的?IDF 版本?再提供多些代码?再提供多些 log?

Code: Select all

#include "esp_adc_cal.h"

void app_main(void)
{
    static esp_adc_cal_characteristics_t *adcChar;
    adcChar = calloc(1, sizeof(esp_adc_cal_characteristics_t));
}
这样最多有个 warning。

gtyxl0
Posts: 2
Joined: Sat Oct 30, 2021 7:37 am

Re: 编译报错does not name a type

Postby gtyxl0 » Tue Nov 02, 2021 5:59 am

用的时arduino,现在换成analogread()读取adc数值了

Who is online

Users browsing this forum: No registered users and 95 guests