Page 1 of 1

Calling XC from C gives Resource dependency exception

Posted: Tue Dec 06, 2016 4:51 pm
by rebb
I have a small XC function which sends bits to 1-bit port in a loop like this:

void sendLSDjTick() {
for(ticks=0;ticks<8;ticks++) {
tmr :> tmr1;
// add delay to t, wait until timer reaches that value
tmr when timerafter (tmr1 + PERIOD) :> void;
x <: 0;
tmr :> tmr1;
// add delay to t, wait until timer reaches that value
tmr when timerafter (tmr1 + PERIOD) :> void;
x <: 1;
}
}

I am calculating samples in C and in every tick length in samples i call sendLSDjTick from my C code.
I am including this header in C file:

#ifndef UIHANDLER_H_
#define UIHANDLER_H_
void sendLSDjTick();
#endif /* UIHANDLER_H_ */

It gives me error, when calling sendLSDjTick:
xrun: Program received signal ET_RESOURCE_DEP, Resource dependency exception.
[Switching to tile[0] core[1]]

Any ideas what causes this? Or is there better way to handle ports from C?

Re: Calling XC from C gives Resource dependency exception

Posted: Wed Dec 07, 2016 12:39 am
by mon2

Re: Calling XC from C gives Resource dependency exception

Posted: Wed Dec 07, 2016 12:51 am
by rebb
There was probably some shared resource between the cores, so i put the function inside channel_funcs and it works just fine. Thanks for the answer!