学前班
最后登录1970-1-1
在线时间 小时
注册时间2019-1-30
|
各位学长,最近在学习systick定时器,按照视频输入代码的时候,在bsp_systick.h文件中包含了"stm32f10x.h"和"core_cm3.h"两个头文件,这时遇到了问题:当代码顺序为include"stm32f10x.h"在先,include"core_cm3.h"在后时,代码编译没问题,但是如果改成include"core_cm3.h"在先,include"stm32f10x.h"在后,则代码报错
请问这是什么情况,在编写代码的时候,包含头文件的顺序也是有影响的吗?
这是代码截图:
下边是编译器报错的具体内容:
Build target 'Led'
compiling bsp_systick.c...
..\..\Libraries\CMSIS\core_cm3.h(1502): error: #20: identifier "IRQn_Type" is undefined
static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1515): error: #20: identifier "IRQn_Type" is undefined
static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1529): error: #20: identifier "IRQn_Type" is undefined
static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1542): error: #20: identifier "IRQn_Type" is undefined
static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1555): error: #20: identifier "IRQn_Type" is undefined
static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1569): error: #20: identifier "IRQn_Type" is undefined
static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1586): error: #20: identifier "IRQn_Type" is undefined
static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
..\..\Libraries\CMSIS\core_cm3.h(1609): error: #20: identifier "IRQn_Type" is undefined
static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
..\..\Libraries\CMSIS\core_cm3.h(1699): error: #20: identifier "SysTick_IRQn" is undefined
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
..\..\User\systick\bsp_systick.h(10): warning: #1-D: last line of file ends without a newline
#endif
..\..\User\systick\bsp_systick.c: 1 warning, 9 errors
"..\..\Output\流水灯.axf" - 9 Error(s), 1 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01
|
|