XC streaming chanend and chan issue

If you have a simple question and just want an answer.
Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

XC streaming chanend and chan issue

Post by Bayanaa »

I have following code:
int main()
{
    chan c_sof;
    chan c_xud_out[EP_CNT_OUT];              /* Endpoint channels for XUD */
    chan c_xud_in[EP_CNT_IN];
    chan c_aud_ctl;
    chan c_mix_out;
    //chan c_dsp;
    streaming chanend c_dsp;
...
}
 
It compiler says :
 
only local variables of type chan allowed in a multi-tile main
 
how to solve it?
I have added following to my code:
#include <xccompat.h>
#define streaming
but still strange and I cannot understand it. Pls help me.


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Chanend type can only be used as argument type in a function.

Try change

streaming chanend c_dsp;

to

streaming chan c_dsp;

And remove the #define streaming. Also ensure that both functions that you are passing c_dsp to use the streaming modifier in their argument list.