Skip to content

Commit dbc4812

Browse files
committed
minor update
1 parent cd6791f commit dbc4812

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

perfc_common.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ extern "C" {
247247
#undef PERFC_CONNECT7
248248
#undef PERFC_CONNECT8
249249
#undef PERFC_CONNECT9
250+
#undef ALT_PERFC_CONNECT2
251+
252+
#undef SAFE_NAME
253+
#undef PERFC_SAFE_NAME
250254

251255
#undef PERFC_CONNECT
252256

@@ -267,6 +271,7 @@ extern "C" {
267271
#define __PERFC_CONNECT9(__A, __B, __C, __D, __E, __F, __G, __H, __I) \
268272
__A##__B##__C##__D##__E##__F##__G##__H##__I
269273

274+
270275
#define ALT_PERFC_CONNECT2(__A, __B) __PERFC_CONNECT2(__A, __B)
271276
#define PERFC_CONNECT2(__A, __B) __PERFC_CONNECT2(__A, __B)
272277
#define PERFC_CONNECT3(__A, __B, __C) __PERFC_CONNECT3(__A, __B, __C)
@@ -287,8 +292,7 @@ extern "C" {
287292
ALT_PERFC_CONNECT2( PERFC_CONNECT, \
288293
__PLOOC_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__)
289294

290-
#undef SAFE_NAME
291-
#undef PERFC_SAFE_NAME
295+
292296

293297
#define SAFE_NAME(__NAME) PERFC_CONNECT3(__,__NAME,__LINE__)
294298
#define PERFC_SAFE_NAME(__name) PERFC_CONNECT3(__,__name,__LINE__)
@@ -395,6 +399,8 @@ extern "C" {
395399
| ((uint64_t)__PERFC_STACK_WATERMARK_U32__ << 32) \
396400
))
397401

402+
#undef __stack_usage__
403+
#undef __stack_usage_max__
398404
#ifdef __PERFC_STACK_GROWS_UPWARD__
399405
/*!
400406
* \brief measure the stack usage of the given code segement

perfc_port_default.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ typedef struct
131131
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
132132
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
133133
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
134-
__IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
134+
__IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
135135
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
136136
__IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
137137
__IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
@@ -171,12 +171,12 @@ bool perfc_port_init_system_timer(bool bTimerOccupied)
171171
SysTick->CTRL = 0;
172172

173173
SysTick->LOAD = SysTick_LOAD_RELOAD_Msk; /* set reload register */
174-
//NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
174+
SCB->SHPR[(((uint32_t)-1) & 0xFUL)-4UL] = __PERFC_SYSTIMER_PRIORITY__; /* set priority */
175175
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
176176
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
177177
SysTick_CTRL_TICKINT_Msk |
178178
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
179-
//SCB->ICSR = SCB_ICSR_PENDSTCLR_Msk;
179+
SCB->ICSR = SCB_ICSR_PENDSTCLR_Msk;
180180
}
181181
} while(0);
182182

0 commit comments

Comments
 (0)