I can run but I cannot hide :D
Emigrating to the XDK+XAI from the USB Audio took some time, but now is the time to solve it - this time for multi-Core => Using channel com.
Code: Select all
int main(){
streaming chan c_render,c_Audio, c_Audio_to_LCD, c_I2S_to_resampling[2],c_res_AUDIO0,c_res_AUDIO1,c_error;
chan c_buttons,c_vector[2],c_tou;
...
The threads that should be stopped now looks like this:
Code: Select all
...
par{
on core_DSP0:{
w_vec FXfir;
initvector(FXfir);
par{
resample(c_I2S_to_resampling[0],c_res_AUDIO0);
send_vec(c_vector[0],FXfir);
lmsfind(c_res_AUDIO0,FXfir);
}
}
on core_DSP1:{
w_vec FXfir;
initvector(FXfir);
par{
resample(c_I2S_to_resampling[1],c_res_AUDIO1);
send_vec(c_vector[1],FXfir);
lmsfind(c_res_AUDIO1,FXfir);
}
}
...
Meanwhile this code is still running, without making the
c_I2S_to_resampling channel to stall
Code: Select all
...
on core_buttons: keys(p_keys,p_keys_led,c_buttons);
on core_LCD :{
databuf buffer={{40,40,40,40,40,40,0,0},{50,50,50,50,50,50,50,50}};
linebuffer frame;
par{
lcd_init(frame,c_render, p_lcd_hsync, p_lcd_dclk, p_lcd_dtmg, p_lcd_rgb);
generate_lcd_screen(frame,c_render, c_vector,c_buttons,c_tou,buffer, p_LED_3_2);
peakhold(c_Audio_to_LCD, buffer);
touch(c_tou);
}
}
on core_expansion : {
mixer MIX;
print_info();
init_pll(scl,sda,MCLK);
printstr("XAI clock multiplier generates ");
printint(MCLK);
printstrln(" kHz master clock");
reset_codec(rst);
init_mixer(MIX);
init_codec(scl, sda);
par {
fsgen(1000, fs);
loopback_vec(c_Audio); //Loopback channels that isn't resampled
{
mswait(1000);
iis(r_iis, c_Audio, c_Audio_to_LCD, c_I2S_to_resampling,MIX);
}
}
}
}
return 0;
I guess their is 2 possible outcomes. I become a loooser or I start understanding things on an instruction level.