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)
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);
}
modeBtnrisingEdgeDetected = false;
modeBtnrisingEdgeTime = 0;
}
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
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
