Update perf_counter.c

This commit is contained in:
Gabriel Wang 2024-12-06 11:10:33 +00:00 committed by GitHub
parent 2d7f024492
commit d36aced13a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,6 +102,11 @@ void perfc_port_clear_system_timer_counter(void);
void perfc_port_insert_to_system_timer_insert_ovf_handler(void) void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
{ {
int64_t lLoad = perfc_port_get_system_timer_top() + 1; int64_t lLoad = perfc_port_get_system_timer_top() + 1;
/* prevent high priority exceptions from preempting the system timer OVF
* exception handling
*/
__IRQ_SAFE {
s_lSystemClockCounts += lLoad; s_lSystemClockCounts += lLoad;
// update system ms counter // update system ms counter
@ -124,7 +129,7 @@ void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
s_wUSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lUS * s_wUSUnit); s_wUSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lUS * s_wUSUnit);
} while(0); } while(0);
}
} }
uint32_t perfc_get_systimer_frequency(void) uint32_t perfc_get_systimer_frequency(void)