cancel
Showing results for 
Search instead for 
Did you mean: 

Output gain set is omitted in WM8904_Init()

ERROR
Senior

Hi,

// WM8904.c
int32_t WM8904_Init(WM8904_Object_t *pObj, WM8904_Init_t *pInit)
  // ...
  if ((WM8904_CurrentDevices & WM8904_OUT_HEADPHONE) == WM8904_OUT_HEADPHONE)
  {
    ret += WM8904_SetVolume(pObj, VOLUME_OUTPUT, (uint8_t)pInit->Volume);
  }

  // ...
  
  /* Store current devices */
  WM8904_CurrentDevices = (pInit->OutputDevice | pInit->InputDevice);

 in line 4, WM8904_CurrentDevices is still 0, so the gain is not set.

I'd change the line this way:

  if ((pInit->OutputDevice & WM8904_OUT_HEADPHONE) == WM8904_OUT_HEADPHONE)
  {
    ret += WM8904_SetVolume(pObj, VOLUME_OUTPUT, (uint8_t)pInit->Volume);
  }

 

1 REPLY 1
Saket_Om
ST Employee

Hello @ERROR 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: 225790 (This is an internal tracking number and is not accessible or usable by customers).

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om