void reset_timer_masked (void)
{
#ifdef GPT_SOFTWARE_WORKAROUND
    register U32 cur_tick;
    // get current tick 
    cur_tick = gpt4_get_current_tick ();
    lastinc = gpt4_tick2time_ms (cur_tick);
#else
		lastinc = gpt4_tick2time_ms (*GPT4_DAT);
#endif    
    timestamp = 0;
}
Esempio n. 2
0
void reset_timer_masked (void)
{
    register U32 cur_tick;
    // get current tick
    cur_tick = gpt4_get_current_tick ();
    lastinc = gpt4_tick2time_ms (cur_tick);
    timestamp = 0;
}
ulong get_timer_masked (void)
{
    volatile U32 now;
#ifdef GPT_SOFTWARE_WORKAROUND  
    register U32 cur_tick;
    // get current tick 
    cur_tick = gpt4_get_current_tick ();
    now = gpt4_tick2time_ms (cur_tick);
#else
		now = gpt4_tick2time_ms (*GPT4_DAT);
#endif
    if (now >= lastinc)
    {
        timestamp = timestamp + now - lastinc;        /* normal */
    }
    else
    {
        timestamp = timestamp + MAX_REG_MS - lastinc + now;   /* overflow */
    }
    lastinc = now;

    return timestamp;
}
Esempio n. 4
0
ulong get_timer_masked (void)
{
	volatile U32 now;

	//now = READ_TIMER;
	now = gpt4_tick2time_ms(*GPT4_DAT);

	if (now >= lastinc) {
		timestamp = timestamp + now - lastinc; 			/* normal */
	} else { 
		timestamp = timestamp + MAX_REG_MS - lastinc + now;	/* overflow */
	}
	lastinc = now;

	return timestamp;
}
Esempio n. 5
0
ulong get_timer_masked (void)
{
    volatile U32 now;
    register U32 cur_tick;
    // get current tick
    cur_tick = gpt4_get_current_tick ();
    now = gpt4_tick2time_ms (cur_tick);

    if (now >= lastinc)
    {
        timestamp = timestamp + now - lastinc;        /* normal */
    }
    else
    {
        timestamp = timestamp + MAX_REG_MS - lastinc + now;   /* overflow */
    }
    lastinc = now;

    return timestamp;
}
Esempio n. 6
0
void reset_timer_masked (void)
{
    lastinc = gpt4_tick2time_ms (*GPT4_DAT);
    timestamp = 0;
}
Esempio n. 7
0
void reset_timer_masked (void)
{
	//lastinc = READ_TIMER;
	lastinc = gpt4_tick2time_ms(*GPT4_DAT);
	timestamp = 0;
}