Browse Source

renew the timer if it underflows

master 2.0.1
Lephenixnoir 4 months ago
parent
commit
a15c193ab7
Signed by: Lephenixnoir GPG Key ID: 1BBA026E13FC0495
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libprof.c

+ 6
- 1
libprof.c View File

@ -10,6 +10,11 @@ uint32_t volatile *prof_tcnt = NULL;
/* Timer ID */
static int prof_timer = -1;
static int callback(void)
{
return TIMER_CONTINUE;
}
/* prof_init(): Initialize the profiler's timer */
int prof_init(void)
{
@ -17,7 +22,7 @@ int prof_init(void)
int timer = -1;
for(int t = 2; t >= 0 && timer == -1; t--)
{
timer = timer_setup(t | TIMER_Pphi_4, 0xffffffff, NULL);
timer = timer_setup(t | TIMER_Pphi_4, 0xffffffff, callback);
}
if(timer == -1)
{


Loading…
Cancel
Save