I am using a C6726 and DSPBios with CCS5. My problem is I cannot get CCS5 to compile when I try to use a pointer to the PIP_getWriterAddr() function as the basis of where to copy data to. The examples as shown in the literature will not compile either.
if (PIP_getWriterNumFrames(&inputpipe) > 0) //how many frames are available
{
PIP_alloc(&inputpipe); /* allocate an empty frame */
addr = PIP_getWriterAddr(&inputpipe);
size = PIP_getWriterSize(&inputpipe);
if(size > 0x10){PIP_setWriterSize(&inputpipe, 0x10);} //set frame to 1 word size 16bits
addr = McASP0ptr[RBUF0];
//enter data in the frame
//sample[] run untill newSamplecount = 0
PIP_put(&inputpipe); //release frame to pipe
newSamplecount--; //data is down pipe, decrement counter
}
In particular the line "addr = McASP0ptr[RBUF0]" causes the error-- #76 operand of "*" must be a pointer
Started with "*addr = McASP0ptr[RBUF0]" thinking it should allow a write to the address referenced by addr but it give another error. I also tried to do a direct cut and paste of the example code
Void copy(HST_Obj *input, HST_Obj *output)
{
PIP_Obj *in, *out;
Uns *src, *dst;
Uns size;
in = HST_getpipe(input);
out = HST_getpipe(output);
if (PIP_getReaderNumFrames(in) == 0 ||
PIP_getWriterNumFrames(out) == 0) {
error;
}
/* get input data and allocate output frame */
PIP_get(in);
PIP_alloc(out);
/* copy input data to output frame */
src = PIP_getReaderAddr(in);
dst = PIP_getWriterAddr(out);
size = PIP_getReaderSize(in);
PIP_setWriterSize(out, size);
for (; size > 0; size--) {
*dst++ = *src++;
}
/* output copied data and free input frame */
PIP_put(out);
PIP_free(in);
}
In this case CCS5 says that a pointer like "*scr" and "*dst" cannot be initialized with Uns.