.clangd 配置 Compiler 后正常了
[C] 纯文本查看 复制代码
CompileFlags:
Compiler: arm-none-eabi-gcc
但是在 CMSIS/core_cm4.h 文件中看到错误:
+ Use of undeclared identifier '__NVIC_PRIO_BITS' (fix available)clang(undeclared_var_use)
+ Unknown type name 'IRQn_Type' (fix available)
快速修复的建议是:在 CMSIS/core_cm4.h 文件头添加 #include "gd32f30x.h"
这种有办法配置吗,现在已经够用了,其实这种无所谓
[C] 纯文本查看 复制代码
/** \brief Decode Priority
The function decodes an interrupt priority value with a given priority group to
preemptive priority value and subpriority value.
In case of a conflict between priority grouping and available
priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
\param [in] PriorityGroup Used priority group.
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
\param [out] pSubPriority Subpriority value (starting from 0).
*/
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
{
uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
uint32_t PreemptPriorityBits;
uint32_t SubPriorityBits;
PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
*pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
*pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
}
|