rename user_code_insert_to_systick_handler as perfc_port_insert_to_system_timer_insert_ovf_handler

This commit is contained in:
Gabriel Wang 2024-01-27 16:09:58 +00:00
parent c743567e60
commit 322de17755
8 changed files with 17 additions and 13 deletions

View File

@ -266,13 +266,13 @@ git clone https://github.com/GorgonMeducer/perf_counter.git
5. Make sure your system contains the CMSIS (with a version 5.7.0 or above) as `perf_counter.h` includes `cmsis_compiler.h`.
6. Call the function `user_code_insert_to_systick_handler()` in your `SysTick_Handler()`
6. Call the function `perfc_port_insert_to_system_timer_insert_ovf_handler()` in your `SysTick_Handler()`
```c
void SysTick_Handler(void)
{
...
user_code_insert_to_systick_handler();
perfc_port_insert_to_system_timer_insert_ovf_handler();
...
}
```

View File

@ -99,7 +99,7 @@ void perfc_port_clear_system_timer_counter(void);
/*============================ IMPLEMENTATION ================================*/
/*============================ INCLUDES ======================================*/
void user_code_insert_to_systick_handler(void)
void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
{
int64_t lLoad = perfc_port_get_system_timer_top() + 1;
s_lSystemClockCounts += lLoad;

View File

@ -313,6 +313,10 @@ extern "C" {
# define __perf_counter_printf__ printf
#endif
/* deprecated macro for backward compatibility */
#define user_code_insert_to_systick_handler \
perfc_port_insert_to_system_timer_insert_ovf_handler
#if __PLOOC_VA_NUM_ARGS() != 0
#warning Please enable GNU extensions, it is required by __cycleof__() and \
__super_loop_monitor__()
@ -909,7 +913,7 @@ extern bool init_cycle_counter(bool bIsSysTickOccupied);
/*!
* \brief a system timer handler inserted to the SysTick_Handler
* \brief a system timer overflow handler
*
* \note - if you are using a compiler other than armcc or armclang, e.g. iar,
* arm gcc etc, the systick_wrapper_ual.o doesn't work with the linker
@ -922,7 +926,7 @@ extern bool init_cycle_counter(bool bIsSysTickOccupied);
* you do NOT have to insert this function into your SysTick_Handler,
* the systick_wrapper_ual.s will do the work for you.
*/
extern void user_code_insert_to_systick_handler(void);
extern void perfc_port_insert_to_system_timer_insert_ovf_handler(void);
/*!
* \brief update perf_counter as SystemCoreClock has been updated.

View File

@ -1090,10 +1090,10 @@ void perfc_port_clear_system_timer_counter(void);
__USED
void DebugMon_Handler(void)
{
perfc_port_pmu_insert_debug_monitor_handler();
perfc_port_pmu_insert_to_debug_monitor_handler();
}
void perfc_port_pmu_insert_debug_monitor_handler(void)
void perfc_port_pmu_insert_to_debug_monitor_handler(void)
{
if (!(SCB->DFSR & SCB_DFSR_PMU_Msk)) {
return ;
@ -1102,7 +1102,7 @@ void perfc_port_pmu_insert_debug_monitor_handler(void)
if (perfc_port_is_system_timer_ovf_pending()) {
perfc_port_clear_system_timer_ovf_pending();
user_code_insert_to_systick_handler();
perfc_port_insert_to_system_timer_insert_ovf_handler();
}
}

View File

@ -30,7 +30,7 @@ typedef uint32_t perfc_global_interrupt_status_t;
/*============================ LOCAL VARIABLES ===============================*/
/*============================ PROTOTYPES ====================================*/
extern
void perfc_port_pmu_insert_debug_monitor_handler(void);
void perfc_port_pmu_insert_to_debug_monitor_handler(void);
/*============================ IMPLEMENTATION ================================*/
__STATIC_INLINE

View File

@ -29,7 +29,7 @@
__wrap_SysTick_Handler:
push {r4, r5}
push {r4, lr}
ldr R0, =user_code_insert_to_systick_handler
ldr R0, =perfc_port_insert_to_system_timer_insert_ovf_handler
blx R0
pop {r4, r5}
mov lr, r5

View File

@ -35,7 +35,7 @@
$Sub$$SysTick_Handler:
push {r4, r5}
push {r4, lr}
ldr R0, =user_code_insert_to_systick_handler
ldr R0, =perfc_port_insert_to_system_timer_insert_ovf_handler
blx R0
pop {r4, r5}
mov lr, r5

View File

@ -22,11 +22,11 @@
|$Sub$$SysTick_Handler| PROC
EXPORT |$Sub$$SysTick_Handler|
IMPORT user_code_insert_to_systick_handler
IMPORT perfc_port_insert_to_system_timer_insert_ovf_handler
IMPORT |$Super$$SysTick_Handler|
push {r4, r5}
push {r4, lr}
LDR R0, =user_code_insert_to_systick_handler
LDR R0, =perfc_port_insert_to_system_timer_insert_ovf_handler
BLX R0
pop {r4, r5}
mov lr, r5