This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: SYS/BIOS : Using TIMER/CLOCK for elapsed time between rising and falling edge of XINT

Part Number: TMS320F28379D

Hi,

Could you suggest any existing Timer/Clock function to get elapsed time between rising and falling edge of an interrupt?

I am trying to distinguish short (less than 1 sec ) and long button presses (1 sec ).

I tried with Clock_getTicks() and checking for LONG_PRESS_DURATION  (10E8) for 1 sec

(as 1 count will be 10 nano sec with 100MHz system clock)

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void gpioInterruptHandler(void)
{
if ((false == modeBtnrisingEdgeDetected) && GPIO_readPin(gpioButton01))
{
modeBtnrisingEdgeDetected = true;
modeBtnrisingEdgeTime = Clock_getTicks();
}
else if ((true == modeBtnrisingEdgeDetected) && !GPIO_readPin(gpioButton01))
{
timeDiff = Clock_getTicks() - modeBtnrisingEdgeTime;
System_printf("System time\n", (ULong)timeDiff);
if (timeDiff < LONG_PRESS_DURATION)
{
GPIO_togglePin(gpioLED01);
}
else
{
GPIO_togglePin(gpioLED04);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I did not initialize any clock and was trying to use the one that is configured by default which shows tickperiod as 1000 and timer period as 2500

It doesnt work with this, could you suggest alternatives?

Thanks,

Rashmitha