I have an issue using Keil rtx message queue. I have two following threads: send_thread and receive_thread.
Pseudo code:
send_thread
{
int16_t array1[20];
int16_t array2[20];
int16_t array3[20];
int16_t *common_array[3]
common_array[0] = array1;
common_array[1] = array2;
common_array[2] = array3;
osMessagePut(MsgBox, (uint32_t)common_array, osWaitForever);
}
receive_thread
{
int16_t receive_array1[20];
int16_t receive_array2[20];
int16_t receive_array3[20];
int16_t *receive_common_array[3]
MsgBox_status = osMessageGet(MsgBox, osWaitForever);
//now here I want to copy all arrays from send_thread to received_arrays.
receive_common_array = MsgBox_status.value.p; //here I should copy the received adress to a new pointer, but I have received just void* variable, so I can't assign like that
memmove(receive_array1, receive_common_array[0], 20);
memmove(receive_array2, receive_common_array[1], 20);
memmove(receive_array3, receive_common_array[2], 20);
}
So the question is what is wrong or how I should implement it? I have debuged the adresses, I get the same one. The difference is that in send_thread the sending variable is pointer to array of pointers, but in receive_thread there is only void* and I can't access any value in that.
Any suggestions are welcome.