欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: C語言結構體定義使用問題error:#167: argument of type "x *" is [打印本頁]

作者: 464545163    時間: 2019-10-18 15:36
標題: C語言結構體定義使用問題error:#167: argument of type "x *" is
在.h文件中定義的
typedef struct
{
  uint8_t Hours;
  uint8_t Minutes;
  uint8_t Seconds;
  uint8_t SubSeconds;
  uint8_t TimeFormat;
  uint8_t DayLightSaving;
  uint8_t StoreOperation;
} RTC_Timetypedef;


在main.c中
RTC_Timetypedef stimestructure;

主函數中
while (1)
  {         
     HAL_RTC_GetTime(&hrtc,&stimestructure, RTC_FORMAT_BCD);
     printf("%02d:%02d:%02d\r\n",stimestructure.Hours, stimestructure.Minutes, stimestructure.Seconds);
     printf("\r\n");
     HAL_Delay(1000);
  }

結果就一直報錯啊
../Src/main.c(154): error:  #167: argument of type "RTC_Timetypedef *" is incompatible with parameter of type "RTC_TimeTypeDef *"
   HAL_RTC_GetTime(&hrtc,&stimestructure, RTC_FORMAT_BCD);
請問各位大佬什么原因啊。


作者: 464545163    時間: 2019-10-18 15:41
是uint8_t沒定義的緣故嗎??
作者: 464545163    時間: 2019-10-18 15:42
是uint8_t的原因嗎

作者: Anger    時間: 2019-10-18 17:12
你把你的HAL_RTC_GetTime函數打開看看他是啥類型參數,庫函數的結構體參數不是在庫里定義好了嗎,你還去定義一遍這個結構體干嘛干嘛,
作者: woshige    時間: 2019-10-21 17:22
參數類型不兼容,也就是說你自己創建的這個結構體不符合這個函數參數所需的結構體,去看看"RTC_TimeTypeDef *"這里面是什么吧
作者: Sky丶藍天    時間: 2019-10-22 18:18
進來學習一下
作者: 1204416316    時間: 2021-10-26 18:41
頭文件交叉包含的問題




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1