编写了一段程序: typedef struct { u16 adcCnt; u16 adcTempVal; void(*init)(); void(*calc)(); u16 adcVal[10]; }ADC_STR; typedef ADC_STR *ADChanlde; #define ADC_STR_defaults { 0,0,\ (void(*)(u16))ADCinit,\ (void(*)(u16))ADChandle,\ 0,0,0,0,0,\ 0,0,0,0,0\ } void ADCinit(ADChanlde ); void ADChandle(ADChanlde ); 主程序中:ADC_STR adcStr = ADC_STR_defaults; 但其会出现如下错误: Error[Pe144]: a value of type "void (*)(u16)" cannot be used to initialize an entity of type "void (*)()" F:\prj\xinzhongyi\src\main.c 9 怎样解决呢? |
RE:IAR编译错误 Error[Pe144],求救
回复:IAR编译错误 Error[Pe144],求救
回复:IAR编译错误 Error[Pe144],求救
ADC_STR和ADC_STR_defaults 的对应类型不匹配。u16 adcTempVal=void(*)(u16))ADCinit?u16!=void
那应该怎么修改呢?
RE:IAR编译错误 Error[Pe144],求救