File tree Expand file tree Collapse file tree 3 files changed +110
-4
lines changed Expand file tree Collapse file tree 3 files changed +110
-4
lines changed Original file line number Diff line number Diff line change 30
30
#ifndef PORTMACRO_H
31
31
#define PORTMACRO_H
32
32
33
+ /* *INDENT-OFF* */
33
34
#ifdef __cplusplus
34
- extern "C" {
35
+ extern "C" {
35
36
#endif
37
+ /* *INDENT-ON* */
36
38
37
39
/*-----------------------------------------------------------
38
40
* Port specific definitions.
@@ -123,8 +125,42 @@ extern void vClearInterruptMaskFromISR( uint32_t ulMask ) __attribute__( ( nake
123
125
124
126
#define portMEMORY_BARRIER () __asm volatile ( "" ::: "memory" )
125
127
126
- #ifdef __cplusplus
128
+
129
+ #define portINLINE __inline
130
+
131
+ #ifndef portFORCE_INLINE
132
+ #define portFORCE_INLINE inline __attribute__( ( always_inline ) )
133
+ #endif
134
+
135
+ /*-----------------------------------------------------------*/
136
+
137
+ portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt ( void )
138
+ {
139
+ uint32_t ulCurrentInterrupt ;
140
+ BaseType_t xReturn ;
141
+
142
+ /* Obtain the number of the currently executing interrupt. */
143
+ __asm volatile ( "mrs %0, ipsr" : "=r" ( ulCurrentInterrupt )::"memory" );
144
+
145
+ if ( ulCurrentInterrupt == 0 )
146
+ {
147
+ xReturn = pdFALSE ;
148
+ }
149
+ else
150
+ {
151
+ xReturn = pdTRUE ;
152
+ }
153
+
154
+ return xReturn ;
127
155
}
156
+
157
+ /*-----------------------------------------------------------*/
158
+
159
+
160
+ /* *INDENT-OFF* */
161
+ #ifdef __cplusplus
162
+ }
128
163
#endif
164
+ /* *INDENT-ON* */
129
165
130
166
#endif /* PORTMACRO_H */
Original file line number Diff line number Diff line change 26
26
*
27
27
*/
28
28
29
+
29
30
#ifndef PORTMACRO_H
30
31
#define PORTMACRO_H
31
32
33
+ /* *INDENT-OFF* */
32
34
#ifdef __cplusplus
33
- extern "C" {
35
+ extern "C" {
34
36
#endif
37
+ /* *INDENT-ON* */
35
38
36
39
/*-----------------------------------------------------------
37
40
* Port specific definitions.
@@ -118,13 +121,45 @@ extern void vClearInterruptMaskFromISR( uint32_t ulMask );
118
121
119
122
#define portNOP ()
120
123
124
+ #define portINLINE __inline
125
+
126
+ #ifndef portFORCE_INLINE
127
+ #define portFORCE_INLINE inline __attribute__( ( always_inline ) )
128
+ #endif
129
+
130
+ /*-----------------------------------------------------------*/
131
+
132
+ portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt ( void )
133
+ {
134
+ uint32_t ulCurrentInterrupt ;
135
+ BaseType_t xReturn ;
136
+
137
+ /* Obtain the number of the currently executing interrupt. */
138
+ __asm volatile ( "mrs %0, ipsr" : "=r" ( ulCurrentInterrupt )::"memory" );
139
+
140
+ if ( ulCurrentInterrupt == 0 )
141
+ {
142
+ xReturn = pdFALSE ;
143
+ }
144
+ else
145
+ {
146
+ xReturn = pdTRUE ;
147
+ }
148
+
149
+ return xReturn ;
150
+ }
151
+
152
+ /*-----------------------------------------------------------*/
153
+
121
154
/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
122
155
* the source code because to do so would cause other compilers to generate
123
156
* warnings. */
124
157
#pragma diag_suppress=Pa082
125
158
159
+ /* *INDENT-OFF* */
126
160
#ifdef __cplusplus
127
- }
161
+ }
128
162
#endif
163
+ /* *INDENT-ON* */
129
164
130
165
#endif /* PORTMACRO_H */
Original file line number Diff line number Diff line change @@ -120,6 +120,41 @@ extern void vClearInterruptMaskFromISR( uint32_t ulMask );
120
120
121
121
#define portNOP ()
122
122
123
+ #define portINLINE __inline
124
+
125
+ #ifndef portFORCE_INLINE
126
+ #define portFORCE_INLINE __forceinline
127
+ #endif
128
+
129
+ /*-----------------------------------------------------------*/
130
+
131
+ static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt ( void )
132
+ {
133
+ uint32_t ulCurrentInterrupt ;
134
+ BaseType_t xReturn ;
135
+
136
+ /* Obtain the number of the currently executing interrupt. */
137
+ __asm
138
+ {
139
+ /* *INDENT-OFF* */
140
+ mrs ulCurrentInterrupt , ipsr
141
+ /* *INDENT-ON* */
142
+ }
143
+
144
+ if ( ulCurrentInterrupt == 0 )
145
+ {
146
+ xReturn = pdFALSE ;
147
+ }
148
+ else
149
+ {
150
+ xReturn = pdTRUE ;
151
+ }
152
+
153
+ return xReturn ;
154
+ }
155
+
156
+ /*-----------------------------------------------------------*/
157
+
123
158
/* *INDENT-OFF* */
124
159
#ifdef __cplusplus
125
160
}
You can’t perform that action at this time.
0 commit comments