I have made the following changes but still the output is same.
void vTaskFunction1( void *pvParameters )
{
char *pcTaskName;
const TickType_t xDelay250ms = pdMS_TO_TICKS( 250 );
/* The string to print out is passed in via the parameter. Cast this to a
character pointer. */
pcTaskName = ( char * ) pvParameters;
/* As per most tasks, this task is implemented in an infinite loop. */
for( ;; )
{
if (xSemaphoreTake(xMutex, 0))
{
ubNbDataToTransmit = 16;
user_uart_tx(pcTaskName, ubNbDataToTransmit);
vTaskDelay( xDelay250ms );
if (xSemaphoreGive(xMutex) != pdTRUE)
{
/* Processing Error */
LED_Blinking(LED_BLINK_ERROR);
}
}
//vPrintString(pcTaskName);
/* Delay for a period. This time a call to vTaskDelay() is used which places
the task into the Blocked state until the delay period has expired. The
parameter takes a time specified in ‘ticks’, and the pdMS_TO_TICKS() macro
is used (where the xDelay250ms constant is declared) to convert 250
milliseconds into an equivalent time in ticks. */
}
}
void vTaskFunction2( void *pvParameters )
{
char *pcTaskName;
const TickType_t xDelay250ms = pdMS_TO_TICKS( 250 );
/* The string to print out is passed in via the parameter. Cast this to a
character pointer. */
pcTaskName = ( char * ) pvParameters;
/* As per most tasks, this task is implemented in an infinite loop. */
for( ;; )
{
if (xSemaphoreTake(xMutex, 0))
{
ubNbDataToTransmit = 20;
user_uart_tx(pcTaskName, ubNbDataToTransmit);
vTaskDelay( xDelay250ms );
if (xSemaphoreGive(xMutex) != pdTRUE)
{
/* Processing Error */
LED_Blinking(LED_BLINK_ERROR);
}
}
//vPrintString(pcTaskName);
/* Delay for a period. This time a call to vTaskDelay() is used which places
the task into the Blocked state until the delay period has expired. The
parameter takes a time specified in ‘ticks’, and the pdMS_TO_TICKS() macro
is used (where the xDelay250ms constant is declared) to convert 250
milliseconds into an equivalent time in ticks. */
}
}
>~~~