|
我在编译应用程序时出现以下警告。HAL_RTC_GetTime 函数要求第一个参数是 RTC_HandleTypeDef 结构体指针,我认为传入的正是这个类型,但仍然收到类型不兼容警告。 15:34:16 Incremental Build of configuration Debug for project RTC make -j8 all arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F407xx -c -I../Core/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/main.o" ../Core/Src/main.c: In function 'HAL_RTC_AlarmAEventCallback': ../Core/Src/main.c:337:49: warning: passing argument 1 of 'HAL_RTC_GetTime' from incompatible pointer type [-Wincompatible-pointer-types] 337 | HAL_RTC_GetTime(&hrtc, &RTC_TimeRead, RTC_FORMAT_BIN); | ^~~~~ | | | RTC_HandleTypeDef ** In file included from ../Core/Inc/stm32f4xx_hal_conf.h:391,
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h:714:54: note: expected 'RTC_HandleTypeDef *' but argument is of type 'RTC_HandleTypeDef **' 714 | HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef hrtc, RTC_TimeTypeDef sTime, uint32_t Format); | 338 | HAL_RTC_GetDate(&hrtc, &RTC_DateRead,RTC_FORMAT_BIN); | ^~~~~ | | | RTC_HandleTypeDef ** In file included from ../Core/Inc/stm32f4xx_hal_conf.h:391,
../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h:716:54: note: expected 'RTC_HandleTypeDef *' but argument is of type 'RTC_HandleTypeDef **' 716 | HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef hrtc, RTC_DateTypeDef sDate, uint32_t Format); | Finished building target: RTC.elf 函数调用如下 HAL_RTC_GetTime(&hrtc, &RTC_TimeRead, RTC_FORMAT_BIN); |
无法从编码器模式下的 TIM1 获取计数值
定时器输出PWM控制电机的问题
STM32U575的LPTIM中断问题
TIM11,TIM13失效
STM32 用主从定时器方式实现DSP QEP模块的QCTMR功能,异常
TIM 单脉冲输出后的电平如何设置?
stm32h7 定时器输出比较模式+dma,生成脉冲异常
STM32CubeMX配置STM32F103C8T6 RTC分频器问题
STM32G473,PA3导致定时器定时误差过大
stm32u575 gpdma burst length=1 配置其他数值不工作
微信公众号
手机版
RTC_HandleTypeDef *' but argument is of type 'RTC_HandleTypeDef **'
你看看你的hrtc的定义,是一个结构体,还是一个结构体指针?