__STATIC_FORCEINLINE any ideas ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

__STATIC_FORCEINLINE any ideas ?

1,235 次查看
randyseedle
Contributor III

I have been trying to get some code to build which uses __STATIC_FORCEINLINE .It produces error/warnings like:

../Source/cmsis_version.h:1723:6: warning: implicit declaration of function '__DSB' [-Wimplicit-function-declaration]
__DSB();

../Source/cmsis_gcc.h:882:22: warning: conflicting types for '__DSB'
__STATIC_INLINE void __DSB(void)
^~~~~
../Source/cmsis_gcc.h:882:22: error: static declaration of '__DSB' follows non-static declaration
In file included from ../Source/core_cm4.h:63:0,
from ../Source/MK64F12.h:264,
from ../Source/fsl_clock.h:14,
from ../Source/fsl_common.h:173,
from ../Source/fsl_sysmpu.h:11,
from ../Source/fsl_sysmpu.c:9:
../Source/cmsis_version.h:1723:6: note: previous implicit declaration of '__DSB' was here
__DSB();

using  __STATIC_INLINE instead you get:

../Source/cmsis_gcc.h:882:22: error: conflicting types for '__DSB'
__STATIC_INLINE void __DSB(void)

../Source/cmsis_version.h:1946:18: note: previous declaration of '__DSB' was here
  __STATIC_INLINE __DSB();                                                          /* Ensure all outstanding memory accesses included

__DSB looks like this:

//__STATIC_FORCEINLINE void __DSB(void)
__STATIC_INLINE void __DSB(void)
{
__ASM volatile ("dsb 0xF":::"memory");
}

What am I missing here ?

标签 (1)
0 项奖励
1 回复

1,132 次查看
mjbcswitzerland
Specialist V

Hi

I think you just need to add a prototype to one of the common headers:

i.e.

extern void __DSB(void);

Regards

Mark

0 项奖励