Post Go back to editing

'AudioLoopBack' and 'RotaryCounter' examples that are not working fine together

Hi All,

I'm actually work with ADSP-BF527 EZ-KIT Lite board and CCES IDE.

So, after practice on 'AudioLoopBack' example, I want to insert a volume control that use the Encoder (I looked to 'RotaryCounter' example).

The volume control work fine but, when I push the encoder for rewrite the 32-bit counter at the default volume level the API fail to perform this!

The program running on a while loop in the fuction main() on 'loopback' program:

1- Receive interrupt from encoder (push) ad handle it by simple set true a control variable.
2- Inside the main() on loopback program at the end the loop I have insert a control as follow:

if (bShaft == true) {

     PresetShaftEncoder(ADC_VOL_LEVEL);          //     Preset Rotary Counter and Volume to default 50% value!

     VolumeLevelADC_0_100 = ADC_VOL_LEVEL;

      bShaft = false;

}

void PresetShaftEncoder(unsigned char PreVal) {

ADI_COUNTER_RESULT  eResult;

if((eResult = adi_counter_SetControlReg(hDevice, ADI_CNT_COUNTER_REG, PreVal)) !=ADI_COUNTER_SUCCESS )

{

     printf("Failed to write '%d' during Preset-Pushbutton: 0x%04X \n", PreVal, eResult);

}

On a Console -> 'Failed to write '50' during Preset-Pushbutton: 0x0002'

After this message the program is still running further but without sound in output and volume control.

Is there anyone that suggest me about this?

Mauro