From 6d19c32cb0bc311838a580d3ec07036ce492d843 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 8 Jan 2012 15:44:59 +0100 Subject: remove lots of dead code --- usb-dfu-experiment/main.c | 74 ----------------------------------------------- 1 file changed, 74 deletions(-) diff --git a/usb-dfu-experiment/main.c b/usb-dfu-experiment/main.c index 001d8c7..d630494 100644 --- a/usb-dfu-experiment/main.c +++ b/usb-dfu-experiment/main.c @@ -68,13 +68,6 @@ * Definitions *----------------------------------------------------------------------------*/ -#if 0 -/** Number of available audio buffers. */ -#define BUFFER_NUMBER 8 -/** Size of one buffer in bytes. */ -#define BUFFER_SIZE (AUDDLoopRecDriver_BYTESPERFRAME*2) -#endif - /// Use for power management #define STATE_IDLE 0 /// The USB device is in suspend state @@ -88,22 +81,6 @@ /// State of USB, for suspend and resume unsigned char USBState = STATE_IDLE; -#if 0 -/** Data buffers for receiving audio frames from the USB host. */ -static uint8_t buffers[BUFFER_NUMBER][BUFFER_SIZE]; -/** Number of samples stored in each data buffer. */ -static uint32_t bufferSizes[BUFFER_NUMBER]; -/** Next buffer in which USB data can be stored. */ -static uint32_t inBufferIndex = 0; -/** Number of buffers that can be sent to the DAC. */ -static volatile uint32_t numBuffersToSend = 0; -#endif - -/** Current state of the playback stream interface. */ -static volatile uint8_t isPlyActive = 0; -/** Current state of the record stream interface. */ -static volatile uint8_t isRecActive = 0; - /*---------------------------------------------------------------------------- * VBus monitoring (optional) *----------------------------------------------------------------------------*/ @@ -193,57 +170,6 @@ static void USBPower_Configure( void ) #endif } -/*---------------------------------------------------------------------------- - * Internal functions - *----------------------------------------------------------------------------*/ - -#if 0 -/** - * Invoked when a frame has been received. - */ -static void FrameReceived(uint32_t unused, - uint8_t status, - uint32_t transferred, - uint32_t remaining) -{ - if (status == USBD_STATUS_SUCCESS) - { - /* Loopback! add this buffer to write list */ - if (!isRecActive) {} - else - { - AUDDLoopRecDriver_Write(buffers[inBufferIndex], - AUDDLoopRecDriver_BYTESPERFRAME, - NULL, 0); - } - - /* Update input status data */ - bufferSizes[inBufferIndex] = transferred - / AUDDLoopRecDriver_BYTESPERSAMPLE; - inBufferIndex = (inBufferIndex + 1) % BUFFER_NUMBER; - numBuffersToSend++; - - } - else if (status == USBD_STATUS_ABORTED) - { - /* Error , ABORT, add NULL buffer */ - bufferSizes[inBufferIndex] = 0; - inBufferIndex = (inBufferIndex + 1) % BUFFER_NUMBER; - numBuffersToSend++; - } - else - { - /* Packet is discarded */ - } - - /* Receive next packet */ - AUDDLoopRecDriver_Read(buffers[inBufferIndex], - AUDDLoopRecDriver_BYTESPERFRAME, - (TransferCallback) FrameReceived, - 0); // No optional argument -} -#endif - /*---------------------------------------------------------------------------- * Callbacks re-implementation *----------------------------------------------------------------------------*/ -- cgit v1.2.3