Hello Carl,
I created small application with MQX 3.8.1 on Kinetis K40 and parameter is passed and shown value matches the one I set. I even checked the parameter through _task_get_parameter(); I have experienced problem with function parameter but that was related to MQX auto start task.
/* code */
#define HELLO_TASK 5
void hello_task(uint_32);
void another_task(uint_32);
const TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/* Task Index, Function, Stack, Priority, Name, Attributes, Param, Time Slice */
{ HELLO_TASK, hello_task, 1500, 8, "hello", MQX_AUTO_START_TASK, 0, 0 },
{ 6, another_task, 1500, 8, "another", 0, 0, 0 },
{ 0 }
};
void another_task(uint_32 a)
{
uint_32 parameter;
printf("\nHello world from another task, parameter value = %u\n", a);
parameter = _task_get_parameter();
printf("\nParameter value another task: %d\n", parameter);
fflush(stdout);
_task_block();
}
void hello_task
(
uint_32 initial_data
)
{
uint_32 task_id;
uint_32 parameter;
task_id = _task_create(0, 6, 255);
parameter = _task_get_parameter_for(task_id);
printf("\nParameter value from main: %d\n", parameter);
fflush(stdout);
_task_block();
}
Regards,
MartinK