Hai all i am new in Freertos… Now i am developing a program with 2 tasks it is working fine but when i am add one function inside the task keil mdk(4) generating an error . I am totally confused about this… is it possible to use a function inside the task?
My Code is as below
void Normal_Control_(void const * argument)
{
void saneesh();
int output;
int ct;
/// MyFunction is below/////
static void saneesh()
{
ct=0;
}
///// MyFunction ending here/////
Generating error is …/Src/main.c(436): error: #65: expected a “;”
…/Src/main.c(508): error: #169: expected a declaration
Actually there is nothing to cause such an error;
If I delete that function then program is working fine
It’s simply a C syntax error completely unrelated to tasks or something.
Define your function e.g. just above Normal_Control_ function optionally with a preceeding declaration.
A task is a FreeRTOS runtime feature but the task main function is just a C-function following a few additional rules required by FreeRTOS as e.g. should not return etc.
Thanks a lot Mr. HS2 and Mr. Richard Barry for your time and Consideration. The problem is solved when I put that function just above the task as Mr.HS2 Suggests. Thank you Very much
Thanks a lot Mr. HS2 for your time and Consideration. The problem is solved when I put that function just above the task as you said. Thank you Very much
Thanks a lot Mr. HS2 for your time and Consideration. The problem is solved when I put that function just above the task as you said. Thank you Very much