summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/src/mscProtocol.c
blob: 47e5c2d8ba3f7368c4dde6d7d33b6018b92a0121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/****************************************************************************//**
  \file mscProtocol.c

  \brief Implementation of communication device protocol command.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
  History:
    29/08/11 N. Fomin - Created
*******************************************************************************/
/******************************************************************************
                   Includes section
******************************************************************************/
#include <mscProtocol.h>
#include <usb.h>

/******************************************************************************
                   Implementations section
******************************************************************************/
/**************************************************************************//**
\brief Mass storage device request handler.
\param[in]
  data - pointer to host's request.
******************************************************************************/
void msdRequestHandler(uint8_t *data)
{
  UsbMscRequest_t *pRequest = NULL;

  pRequest = (UsbMscRequest_t *)data;
  if (NULL == pRequest)
    return;

  // Check request code
  switch (pRequest->request.bRequest)
  {
    case BULK_ONLY_MASS_STORAGE_RESET:
      break;
    case GET_MAX_LUN:
      HAL_Stall(0);
      break;
    default:
      HAL_Stall(0);
      break;
  }
}

//eof mscProtocol.c