I'm trying to compile FreeRTOS for PIC18F devices using SDCC but with no success. I'm testing a simple example I got from somewhere. The code mainly does nothig but when compiling I get this error:
main.c:43: error 78: incompatible types
from type 'void generic* '
to type 'void generic* generic* '
The error refers to the first parameter in this function:
xTaskCreate( vTestTask, "Hello", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
This function is defined:
signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask ); // Defined in task.h
and pdTASK_CODE is defined as: typedef void (*pdTASK_CODE)( void * ); // Defined in projdefs.h
My task is defined as:
static void vTestTask( void *pvParameters ); // Dummy task which does nothing.
What is wrong here? Why are they incompatible?
If I make this in the main code before calling the funcion to create a task:
ptr = vTestTask;
I get no errors at that point, but if I use ptr as first parameter to the function I get the same error as before. I do not understand anything...
Thanks in advance
Problem soved. The last parameter of the function cannot be NULL... I've spent a lot of time trying to solve a problem that did not exist at all...
Log in to post a comment.