I am trying to use some memory between two parallel tasks and I am ensuring that same memory regions are never used at same time in these two threads.
But xc compiler throws parallel usage rules error. After going through some post, I decided to add c functionality to write to and read from memory regions.
To do this I am trying to pass unsafe pointer from xc file to C function, but then I get function mismatch error because of xC pointer and C pointer.
How to fix this?
Below is my simple code base:
In xc file:
Code: Select all
unsafe void bufferData(mic_array_frame_time_domain * unsafe audio)
{
static uint16_t wrIdx = 0;
fillMicData((mic_array_frame_time_domain*)audio, wrIdx); //ERROR here!!!
if(wrIdx < BUFFER_SIZE-1)
wrIdx++;
else {
wrIdx = 0;
}
}
Code: Select all
void fillMicData(mic_array_frame_time_domain* audio, uint16_t wrIdx);
Shailesh