Dear All,
Can anybody suggest me how to use printf() for debugging in this following simple code. I have used this format printf("value %d",i) but did not worked. I have heard about log_printf , bit did not able to use. Plz suggest me a suitable debugging method.
Thanks in adv.
(reader may get surprise with this code. plz dont be surprised the code has been built to perform ofdm, but unnecessary line has been deleted to make it small to post here. I believe procedure to use print which will be suggested for this code here, will work on the complex code also)
* ======== tone.c ========
#include "tonecfg.h"
#include "stdio.h"
#include "stdlib.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "dsk6713_led.h"
#include "dsk6713_dip.h"
# include "math.h"
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
0x0017, // 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume
0x0017, // 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
0x00d8, // 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume
0x00d8, // 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume
0x0011, // 4 DSK6713_AIC23_ANAPATH Analog audio path control
0x0000, // 5 DSK6713_AIC23_DIGPATH Digital audio path control
0x0000, // 6 DSK6713_AIC23_POWERDOWN Power down control
0x0043, // 7 DSK6713_AIC23_DIGIF Digital audio interface format
0x0001, // 8 DSK6713_AIC23_SAMPLERATE Sample rate control
0x0001 // 9 DSK6713_AIC23_DIGACT Digital interface activation
};
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
Uint32 leftsample,rightsample;
int N=64,i=0,j=0;
double y[128];
double x[128];
double w[128];
for(i=0;i<128;i++)
{
x[i]=0;
y[i]=0;
}
DSK6713_init();
hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq(hCodec,DSK6713_AIC23_FREQ_48KHZ);
gen_w_r2(w, N); // Generate coefficient table
while(1)
{ while (!DSK6713_AIC23_read(hCodec,&leftsample));
while (!DSK6713_AIC23_read(hCodec,&rightsample));
x[2*i]=leftsample;
x[2*i+1]=0;
while (!DSK6713_AIC23_write(hCodec,5*y[2*i]));
while (!DSK6713_AIC23_write(hCodec,5*y[2*i+1]));
if(i==63)
{
for(j=0;j<=127;j++)
{
y[j]=x[j];
}
i=-1;
}
i++; }
DSK6713_AIC23_closeCodec(hCodec);
}