I'm a total beginner with xmos, so pardon my ignorance.
I've purchased the xCORE.ai Audio evaluation board, and I'm trying to run a task along with a 8in/8out audio application.
For now I'm simply trying to run a task to switch some leds on or off every x seconds (using hwtimer_t).
I've updated user_main.h from app_usb_aud_xk_316_mc to add the call to "myTask":
Code: Select all
#define USER_MAIN_CORES on tile[0]: {\
ctrlPort();\
i2c_master(i2c, 1, p_scl, p_sda, 100);\
}\
on tile[1]: {\
unsafe\
{\
i_i2c_client = i2c[0];\
}\
myTask();\
}
Code: Select all
void myTask() {
unsigned long currTime = 0, prevTime = 0;
int on = 1;
hwtimer_t timer = hwtimer_alloc();
while(1) {
currTime = hwtimer_get_time(timer);
if (currTime - prevTime > 100000000) {
prevTime = currTime;
if (on) {
ledsOn();
}
else {
ledsOff();
}
on = (on == 1) ? 0 : 1;
}
}
hwtimer_free(timer);
}
Is it because the task is running on the audio tile?
I've looked at the main.xc in lib_xua and I thought the task would run in parallel on a different core, but this doesn't seem to be the case.
Thanks for your help!