Exemplo n.º 1
0
/*******************************************************************************
* Function Name  : Out0_Process
* Description    : Process the OUT token on all default endpoint.
* Input          : None.
* Output         : None.
* Return         : Post0_Process.
*******************************************************************************/
uint8_t Out0_Process(void) {
    uint32_t ControlState = pInformation->ControlState;

    if((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA)) {
        /* host aborts the transfer before finish */
        ControlState = STALLED;
    } else if((ControlState == OUT_DATA) || (ControlState == LAST_OUT_DATA)) {
        DataStageOut();
        ControlState = pInformation->ControlState; /* may be changed outside the function */
    }

    else if(ControlState == WAIT_STATUS_OUT) {
        (*pProperty->Process_Status_OUT)();
#ifndef STM32F10X_CL
        ControlState = STALLED;
#endif /* STM32F10X_CL */
    }


    /* Unexpect state, STALL the endpoint */
    else {
        ControlState = STALLED;
    }

    pInformation->ControlState = ControlState;

    return Post0_Process();
}
Exemplo n.º 2
0
/*******************************************************************************
* Function Name  : Out0_Process
* Description    : Process the OUT token on all default endpoint.
* Input          : None.
* Output         : None.
* Return         : Post0_Process.
*******************************************************************************/
uint8_t Out0_Process(void) {
	uint32_t ControlState = pInformation->ControlState;

	if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA)) {
		// host aborts the transfer before finish
		ControlState = STALLED;
	} else if ((ControlState == OUT_DATA) || (ControlState == LAST_OUT_DATA)) {
		DataStageOut();
		ControlState = pInformation->ControlState; // may be changed outside the function
	} else if (ControlState == WAIT_STATUS_OUT) {
		(*pProperty->Process_Status_OUT)();
		ControlState = STALLED;
	} else {
		// Unexpect state, STALL the endpoint
		ControlState = STALLED;
	}
	pInformation->ControlState = ControlState;

	return Post0_Process();
}
Exemplo n.º 3
0
/*******************************************************************************
* Function Name  : Out0_Process
* Description    : Process the OUT token on all default endpoint.
* Input          : None.
* Output         : None.
* Return         : Post0_Process.
*******************************************************************************/
u8 Out0_Process(void)
{

  u32 ControlState = pInformation->ControlState;
                  #ifdef DEBUG_EP0
    putchar('U');
    #endif

                  #ifdef DEBUG_EP0
    putchar('q');
    #endif
  if ((ControlState == OUT_DATA) || (ControlState == LAST_OUT_DATA))
  {
    DataStageOut();
    ControlState = pInformation->ControlState; /* may be changed outside the function */
  }
  else if (ControlState == WAIT_STATUS_OUT)
  {
    (*pProperty->Process_Status_OUT)();
    ControlState = STALLED;
  }

  else if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))
  {
    /* host aborts the transfer before finish */
    ControlState = STALLED;
  }

  /* Unexpect state, STALL the endpoint */
  else
  {
    ControlState = STALLED;
  }

  pInformation->ControlState = ControlState;

  return Post0_Process();
}