/*******************************************************************************
* Function Name  : MASS_init
* Description    : Mass Storage init routine.
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void MASS_init()
{
  pInformation->Current_Configuration = 0;

  /* Connect the device */
  PowerOn();

  /* USB interrupts initialization */
  /* clear pending interrupts */
  _SetISTR(0);
  wInterrupt_Mask = IMR_MSK;
  /* set interrupts mask */
  _SetCNTR(wInterrupt_Mask);
  pInformation->Current_Feature = MASS_ConfigDescriptor[7];

  /* Wait until device is configured */
  while (pInformation->Current_Configuration == 0)
  {
    NOP_Process();
    if(ReadKey() != NOKEY)
    {
      return;
    }
  }
  bDeviceState = CONFIGURED;
}
Пример #2
0
/*******************************************************************************
* Function Name  : Virtual_Com_Port_init
* Description    : Virtual_Com_Port Mouse init routine
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void Virtual_Com_Port_init(void)
{
    pInformation->Current_Configuration = 0;
    /* Connect the device */
    PowerOn();
    /* USB interrupts initialization */
    _SetISTR(0);               /* clear pending interrupts */
    wInterrupt_Mask = IMR_MSK;
    _SetCNTR(wInterrupt_Mask); /* set interrupts mask */
    pInformation->Current_Feature = Virtual_Com_Port_ConfigDescriptor[7];
    /* Wait until device is configured */
    SuspendCnt=0;
    while (pInformation->Current_Configuration == 0) NOP_Process();
    bDeviceState = CONFIGURED;
}
Пример #3
0
/*******************************************************************************
* Function Name  : DFU_init
* Description    :
* Input          :None
* Output         :None
* Return         :None
*******************************************************************************/
void DFU_init(void)
{
 DEVICE_INFO *pInfo = &Device_Info;

	pInfo->Current_Configuration = 0;
        pInfo->Current_Feature = DFU_ConfigDescriptor[7];

	/* Connect the device */
	PowerOn();
        /* USB interrupts initialization */
        _SetISTR(0);               /* clear pending interrupts */
        wInterrupt_Mask = IMR_MSK;
        _SetCNTR(wInterrupt_Mask); /* set interrupts mask */

        /* Enable USB interrupts */
        USB_Interrupts_Config();

        /* Wait until device is configured */
	while (pInfo->Current_Configuration == 0) NOP_Process();


	bDeviceState = CONFIGURED;
} /* DFU_init() */