we are preparing for analog inputs voulme level meter display on panel, i tried to read out ADC convert result from deliver( ) in audio.xc
but g_in_0 didn't change almost even inputing analog voice signal (from Micphone, we can record and playback voice with Audacity tool )
where and how to get analog input volume data ? Thanks!
Code: Select all
[/#pragma loop unroll
/* First time around we get channel 7 of TDM8 */
for(int i = 0; i < I2S_CHANS_ADC; i+=I2S_CHANS_PER_FRAME)
{
// p_i2s_adc[index++] :> sample;
// Manual IN instruction since compiler generates an extra setc per IN (bug #15256)
unsigned sample;
unsigned sample_0;
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index++]));
/* Note the use of readBuffNo changes based on frameCount */
[highlight=yellow]if (i ==0){
sample_0 = sample & 0x7fffffff;
sample_0 = sample_0 >> 7;
SET_SHARED_GLOBAL( g_in_0, sample_0);
// vu_calc_in_0(sample_0);
}[/highlight]
if(buffIndex)
samplesIn_1[((frameCount-2)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample); // channels 0, 2, 4.. on each line.
else
samplesIn_0[((frameCount-2)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample);
}code]