Page 1 of 1

编译报错does not name a type

Posted: Sat Oct 30, 2021 7:41 am
by gtyxl0
  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
试过很多方法,都不能解决

Re: 编译报错does not name a type

Posted: Mon Nov 01, 2021 1:21 am
by ESP_Gargamel
你具体咋整的?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。

Re: 编译报错does not name a type

Posted: Tue Nov 02, 2021 5:59 am
by gtyxl0
用的时arduino,现在换成analogread()读取adc数值了