Hello thebig1,
Welcome to the forum,
Your code slightly revised:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
// <--- Missing function definition.
{ /* begin of FUNCTION BLOCK: Timer */
/* type code here */
RTE_Services_Time_ReadTime(&u32CurrentTime);
if (ENABLE != true)
{ // <-- Not needed for a single statement.
return false;
}
else // <--- Missing.
{
Q = (u32CurrentTime - u32StartTime);
}
RTE_Services_Time_ReadTime(&u32StartTime);
return true;
// Not needed. Bothe the {} and the code
//{
//Exit:
// return false;
//}
} /* end of FUNCTION BLOCK: Timer */
|
I can only guess that "ENABLE" is a variable passed to the function. I do not see it or how it is passed.
Just like I can only guess that "RTE_Services_Time_ReadTime" is from a header file that I am not familiar with.
Your line 10 using a "goto" is bad programming. It is much better to use "return false;" in its place.
Between your lines 11 and 12 you are missing an "else" statement.
Your line 13 uses the variables "u32CurrentTime" and "u32StartTim", but where did these variables get their value.
Not sure if you realize it or not, but your line 18 is the end of the function and what comes after should not be used.
If you are using a header file that is not common you need to note this in your question.
Hope that helps for now,
Andy
P.S. Realized that "ENABLE" may need to be toggled somewhere in the function.