Changeset 6233c4e in mainline for uspace/drv/audio/sb16/dsp.c


Ignore:
Timestamp:
2011-10-24T21:50:31Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88dcd19
Parents:
0b4f060
Message:

sb16: Prettify debug output.

Add mode to string conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    r0b4f060 r6233c4e  
    4343#include "dsp.h"
    4444
    45 #define PLAYBACK_16BIT 0x10
    46 #define PLAYBACK_STEREO 0x20
    47 
    4845#define BUFFER_SIZE (PAGE_SIZE / 4)
    4946#define PLAY_BLOCK_SIZE (BUFFER_SIZE / 2)
     
    145142static inline size_t sample_count(uint8_t mode, size_t byte_count)
    146143{
    147         if (mode & PLAYBACK_16BIT) {
     144        if (mode & DSP_MODE_16BIT) {
    148145                return byte_count / 2;
    149146        }
     
    279276        dsp->playing.mode = 0;
    280277        if (sample_size == 16)
    281                 dsp->playing.mode |= PLAYBACK_16BIT;
     278                dsp->playing.mode |= DSP_MODE_16BIT;
    282279        if (channels == 2)
    283                 dsp->playing.mode |= PLAYBACK_STEREO;
     280                dsp->playing.mode |= DSP_MODE_STEREO;
    284281
    285282        const size_t samples = sample_count(dsp->playing.mode, play_size);
    286283
    287         ddf_log_debug("Playing sound(%hhx): %zu(%zu) bytes => %zu samples.\n",
    288             dsp->playing.mode, play_size, size, samples);
     284        ddf_log_debug("Playing %s sound: %zu(%zu) bytes => %zu samples.\n",
     285            mode_to_str(dsp->playing.mode), play_size, size, samples);
    289286
    290287        memcpy(dsp->buffer.data, dsp->playing.data, copy_size);
Note: See TracChangeset for help on using the changeset viewer.