Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Encoder
RTC
5
encoder添加驱动后,drv_rtc.c报错
发布于 2021-05-29 17:27:33 浏览:1285
订阅该版
./libraries/drivers/drv_rtc.c:36:8: error: unknown type name 'RTC_HandleTypeDef' static RTC_HandleTypeDef RTC_Handler; ^ ../libraries/drivers/drv_rtc.c: In function 'get_rtc_timestamp': ../libraries/drivers/drv_rtc.c:40:5: error: unknown type name 'RTC_TimeTypeDef' RTC_TimeTypeDef RTC_TimeStruct = {0}; ^ ../libraries/drivers/drv_rtc.c:41:5: error: unknown type name 'RTC_DateTypeDef' RTC_DateTypeDef RTC_DateStruct = {0}; ^ ../libraries/drivers/drv_rtc.c:44:5: warning: implicit declaration of function 'HAL_RTC_GetTime' [-Wimplicit-function-declaration] HAL_RTC_GetTime(&RTC_Handler, &RTC_TimeStruct, RTC_FORMAT_BIN); ^ ../libraries/drivers/drv_rtc.c:44:52: error: 'RTC_FORMAT_BIN' undeclared (first use in this function) HAL_RTC_GetTime(&RTC_Handler, &RTC_TimeStruct, RTC_FORMAT_BIN); ^ ../libraries/drivers/drv_rtc.c:44:52: note: each undeclared identifier is reported only once for each function it appears in ../libraries/drivers/drv_rtc.c:45:5: warning: implicit declaration of function 'HAL_RTC_GetDate' [-Wimplicit-function-declaration] HAL_RTC_GetDate(&RTC_Handler, &RTC_DateStruct, RTC_FORMAT_BIN); ^ ../libraries/drivers/drv_rtc.c:47:36: error: request for member 'Seconds' in something not a structure or union tm_new.tm_sec = RTC_TimeStruct.Seconds; ^ ../libraries/drivers/drv_rtc.c:48:36: error: request for member 'Minutes' in something not a structure or union tm_new.tm_min = RTC_TimeStruct.Minutes; ^ ../libraries/drivers/drv_rtc.c:49:36: error: request for member 'Hours' in something not a structure or union tm_new.tm_hour = RTC_TimeStruct.Hours; ^ ../libraries/drivers/drv_rtc.c:50:36: error: request for member 'Date' in something not a structure or union tm_new.tm_mday = RTC_DateStruct.Date; ^ ../libraries/drivers/drv_rtc.c:51:36: error: request for member 'Month' in something not a structure or union tm_new.tm_mon = RTC_DateStruct.Month - 1; ^ ../libraries/drivers/drv_rtc.c:52:36: error: request for member 'Year' in something not a structure or union tm_new.tm_year = RTC_DateStruct.Year + 100; ^ ../libraries/drivers/drv_rtc.c: In function 'set_rtc_time_stamp': ../libraries/drivers/drv_rtc.c:60:5: error: unknown type name 'RTC_TimeTypeDef' RTC_TimeTypeDef RTC_TimeStruct = {0}; ^ ../libraries/drivers/drv_rtc.c:61:5: error: unknown type name 'RTC_DateTypeDef' RTC_DateTypeDef RTC_DateStruct = {0}; ^ ../libraries/drivers/drv_rtc.c:70:19: error: request for member 'Seconds' in something not a structure or union RTC_TimeStruct.Seconds = p_tm->tm_sec ; ^ ../libraries/drivers/drv_rtc.c:71:19: error: request for member 'Minutes' in something not a structure or union RTC_TimeStruct.Minutes = p_tm->tm_min ; ^ ../libraries/drivers/drv_rtc.c:72:19: error: request for member 'Hours' in something not a structure or union RTC_TimeStruct.Hours = p_tm->tm_hour; ^ ../libraries/drivers/drv_rtc.c:73:19: error: request for member 'Date' in something not a structure or union RTC_DateStruct.Date = p_tm->tm_mday; ^ ../libraries/drivers/drv_rtc.c:74:19: error: request for member 'Month' in something not a structure or union RTC_DateStruct.Month = p_tm->tm_mon + 1 ; ^ ../libraries/drivers/drv_rtc.c:75:19: error: request for member 'Year' in something not a structure or union RTC_DateStruct.Year = p_tm->tm_year - 100; ^ ../libraries/drivers/drv_rtc.c:76:19: error: request for member 'WeekDay' in something not a structure or union RTC_DateStruct.WeekDay = p_tm->tm_wday + 1; ^ ../libraries/drivers/drv_rtc.c:78:9: warning: implicit declaration of function 'HAL_RTC_SetTime' [-Wimplicit-function-declaration] if (HAL_RTC_SetTime(&RTC_Handler, &RTC_TimeStruct, RTC_FORMAT_BIN) != HAL_OK) ^ ../libraries/drivers/drv_rtc.c:78:56: error: 'RTC_FORMAT_BIN' undeclared (first use in this function) if (HAL_RTC_SetTime(&RTC_Handler, &RTC_TimeStruct, RTC_FORMAT_BIN) != HAL_OK) ^ ../libraries/drivers/drv_rtc.c:82:9: warning: implicit declaration of function 'HAL_RTC_SetDate' [-Wimplicit-function-declaration] if (HAL_RTC_SetDate(&RTC_Handler, &RTC_DateStruct, RTC_FORMAT_BIN) != HAL_OK) ^ ../libraries/drivers/drv_rtc.c: In function 'rt_rtc_config': ../libraries/drivers/drv_rtc.c:129:16: error: request for member 'Instance' in something not a structure or union RTC_Handler.Instance = RTC; ^ ../libraries/drivers/drv_rtc.c:158:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.AsynchPrediv = 0X7F; ^ ../libraries/drivers/drv_rtc.c:160:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.SynchPrediv = 0XFF; ^ ../libraries/drivers/drv_rtc.c:162:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.HourFormat = RTC_HOURFORMAT_24; ^ ../libraries/drivers/drv_rtc.c:162:39: error: 'RTC_HOURFORMAT_24' undeclared (first use in this function) RTC_Handler.Init.HourFormat = RTC_HOURFORMAT_24; ^ ../libraries/drivers/drv_rtc.c:163:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.OutPut = RTC_OUTPUT_DISABLE; ^ ../libraries/drivers/drv_rtc.c:163:35: error: 'RTC_OUTPUT_DISABLE' undeclared (first use in this function) RTC_Handler.Init.OutPut = RTC_OUTPUT_DISABLE; ^ ../libraries/drivers/drv_rtc.c:164:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; ^ ../libraries/drivers/drv_rtc.c:164:43: error: 'RTC_OUTPUT_POLARITY_HIGH' undeclared (first use in this function) RTC_Handler.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; ^ ../libraries/drivers/drv_rtc.c:165:20: error: request for member 'Init' in something not a structure or union RTC_Handler.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; ^ ../libraries/drivers/drv_rtc.c:165:39: error: 'RTC_OUTPUT_TYPE_OPENDRAIN' undeclared (first use in this function) RTC_Handler.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; ^ ../libraries/drivers/drv_rtc.c:167:13: warning: implicit declaration of function 'HAL_RTC_Init' [-Wimplicit-function-declaration] if (HAL_RTC_Init(&RTC_Handler) != HAL_OK) ^ make: *** [libraries/drivers/subdir.mk:51: libraries/drivers/drv_rtc.o] Error 1 make: *** Waiting for unfinished jobs.... "make -j8 all" terminated with exit code 2. Build might be incomplete. 我尝试了各种方法终于把ART-PI的编码器驱动加进去了,增加了所有定义后,编码器文件没报错,但是rtc开始报错了,,实在没办法了,,求大家帮我看看哪里有问题“?
查看更多
wwk
2021-05-29
这家伙很懒,什么也没写!
问题刚找到,,谢谢大家。
2
个回答
默认排序
按发布时间排序
flashman2002
2021-05-29
这家伙很懒,什么也没写!
应该是你的RTC没有定义好。请和对一下rtconfig.h中的有关RTC内容。
撰写答案
登录
注册新账号
关注者
0
被浏览
1.3k
关于作者
wwk
这家伙很懒,什么也没写!
提问
32
回答
9
被采纳
1
关注TA
发私信
相关问题
1
RTC驱动框架几点建议
2
求助:RTT在STM32F407上使用内置的RTC设置日期需重启生效,设置时间即时生效,有遇到同样问题的吗?
3
[新人试水] LPC1768 Nano3_9 添加RTC
4
STM32 关于RTC的问题
5
stm32f4xx-HAL BSP的RTC设置不对
6
关于STM32的RTC设置年份不正确的问题
7
RTT的RTC驱动调试
8
rtc驱动中的bkp模块起不到防止时间的重新设置
9
rtc时钟跑十几个小时后,比实际时间快几秒怎么解决
10
stm32如何断电之后开发板rtc时间继续往前跑
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
a1012112796
13
个答案
2
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
8
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
5
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部