-
Notifications
You must be signed in to change notification settings - Fork 405
AT32官方已添加SystemCoreClock支持,导致重复定义 #404
Description
描述一下这个bug / Describe the bug
我准备使用 AT32F435 移植,编译失败报重复定义SystemCoreClock的错误。
查看发现 port/dwc2/usb_glue_at.c 中 定义了 SystemCoreClock
而在AT32新版库文件中,已提供 SystemCoreClock 定义
#define SystemCoreClock system_core_clock
参考:https://github.com/ArteryTek/AT32F435_437_Firmware_Library/blob/master/libraries/cmsis/cm4/device_support/system_at32f435_437.h v2.0.9 版本添加
复现步骤 / To Reproduce
将 CherryUSB 添加到项目,添加 Cmake 配置,编译不通过。
设备信息 / Target Device
芯片型号: AT32F435
引脚: PA11,PA12
USP IP: dwc2
日志 / Log
[build] XXX/libraries/cmsis/cm4/device_support/system_at32f435_437.h:41:42: error: conflicting types for 'system_core_clock'; have 'uint32_t' {aka 'long unsigned int'}
[build] 41 | #define SystemCoreClock system_core_clock
[build] | ^~~~~~~~~~~~~~~~~
[build] XXX/user/libs/CherryUSB/usb_glue_at.c:12:10: note: in expansion of macro 'SystemCoreClock'
[build] 12 | uint32_t SystemCoreClock;
[build] | ^~~~~~~~~~~~~~~
[build] XXX/user/libs/CherryUSB/usb_glue_at.c:10:21: note: previous declaration of 'system_core_clock' with type 'unsigned int'
[build] 10 | extern unsigned int system_core_clock;
[build] | ^~~~~~~~~~~~~~~~~
配置 / Configuration
No response
USB中断 / USB Interrupt
No response
缓存 / Cache
No response
商业 / Business
- 是 / Yes