Skip to content

Commit

Permalink
Improve compatibility with CMSIS 6.1.0
Browse files Browse the repository at this point in the history
Fix __sev, __wfi, __wfe, and __dmb issues
  • Loading branch information
will-v-pi committed May 22, 2024
1 parent 6d5064c commit 2cf649c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RaspberryPi.RP2xxx_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
<files>

<file category="include" name="__wrapper/" />
<file category="preIncludeGlobal" name="__wrapper/env_wrapper.h" version="1.5.1" attr="config" />
<file category="preIncludeGlobal" name="__wrapper/env_wrapper.h" version="1.5.2" attr="config" />
<file category="sourceC" name="__wrapper/env_wrapper.c" />


Expand Down
16 changes: 15 additions & 1 deletion __wrapper/env_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,21 @@ typedef unsigned int uint;
#define __wfi __builtin_arm_wfi
#define __wfe __builtin_arm_wfe

#define __dmb __DMB
#ifndef __PLOOC_VA_NUM_ARGS_IMPL
# define __PLOOC_VA_NUM_ARGS_IMPL( _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11, \
_12,_13,_14,_15,_16,__N,...) __N
#endif

#ifndef __PLOOC_VA_NUM_ARGS
#define __PLOOC_VA_NUM_ARGS(...) \
__PLOOC_VA_NUM_ARGS_IMPL( 0,##__VA_ARGS__,16,15,14,13,12,11,10,9, \
8,7,6,5,4,3,2,1,0)
#endif

#define __dmb0() __builtin_arm_dmb(0xF)
#define __dmb1(__N) __builtin_arm_dmb(__N)

#define __dmb(...) __CONCAT(__dmb, __PLOOC_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__)

#define __dsb __DSB
#define __isb __ISB
Expand Down
2 changes: 1 addition & 1 deletion pico-sdk

0 comments on commit 2cf649c

Please sign in to comment.