Esempio n. 1
0
static void audio_callback(FAR void *handle, uint16_t reason,
        FAR struct ap_buffer_s *apb, uint16_t status)
#endif
{
  FAR struct audio_upperhalf_s *upper = (FAR struct audio_upperhalf_s *)handle;

  audllvdbg("Entry\n");

  /* Perform operation based on reason code */

  switch (reason)
    {
      case AUDIO_CALLBACK_DEQUEUE:
        {
          /* Call the dequeue routine */

#ifdef CONFIG_AUDIO_MULTI_SESSION
          audio_dequeuebuffer(upper, apb, status, session);
#else
          audio_dequeuebuffer(upper, apb, status);
#endif
          break;
        }

      /* Lower-half I/O error occurred */

      case AUDIO_CALLBACK_IOERR:
        {
        }
        break;

      /* Lower-half driver has completed a playback */

      case AUDIO_CALLBACK_COMPLETE:
        {
          /* Send a complete message to the user if a message queue is registered */

#ifdef CONFIG_AUDIO_MULTI_SESSION
          audio_complete(upper, apb, status, session);
#else
          audio_complete(upper, apb, status);
#endif
        }
        break;

      default:
        {
          auddbg("Unknown callback reason code %d\n", reason);
          break;
        }
    }
}
Esempio n. 2
0
static void audio_callback(FAR void *handle, uint16_t reason,
        FAR struct ap_buffer_s *apb, uint16_t status)
{
  FAR struct audio_upperhalf_s *upper = (FAR struct audio_upperhalf_s *)handle;

  audllvdbg("Entry\n");

  /* Perform operation based on reason code */

  switch (reason)
    {
      case AUDIO_CALLBACK_DEQUEUE:
        {
          /* Call the dequeue routine */

          audio_dequeuebuffer(upper, apb, status);
          break;
        }

      case AUDIO_CALLBACK_IOERR:
        {
        }
        break;

      default:
        {
          auddbg("Unknown callback reason code %d\n", reason);
          break;
        }
    }
}