Function call From a Task Generating ERROR
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 NormalControl(void const * argument)
{
void saneesh();
int output;
int ct;
/// MyFunction is below/////
static void saneesh()
{
ct=0;
}
///// MyFunction ending here/////
/* Infinite loop /
for(;;)
{
osSemaphoreWait(Voltage_CTRLHandle,1);
output=voltage;
osSemaphoreRelease(Voltage_CTRLHandle);
sprintf(msg, “%drn”,output);
HAL_UART_Transmit(&huart2,(uint8_t)msg,20,100);
osDelay(2000);
}
}
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
Please help me…
Thanks in advance
Function call From a Task Generating ERROR
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.
Function call From a Task Generating ERROR
This is just a compiler build error as you have invalid C syntax
somewhere in your code – completely unrelated to FreeRTOS.
Function call From a Task Generating ERROR
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
Function call From a Task Generating ERROR
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
Function call From a Task Generating ERROR
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