/* ** =================================================================== ** Method : CDC1_RecvChar (component FSL_USB_CDC_Device) ** Description : ** Receives a character from the USB interface. Function is ** blocking if there is no character in the input buffer. ** Parameters : ** NAME - DESCRIPTION ** * Chr - Pointer to where to store the character ** received ** Returns : ** --- - Error code, ERR_OK for success, ** ERR_RXEMPTY if nothing is in RX buffer. ** =================================================================== */ uint8_t CDC1_RecvChar(CDC1_TComData *Chr) { while(Rx1_Get(Chr)!=ERR_OK) { /* retry receiving until success */ } return ERR_OK; }
//Rx1_ElementType nRX_Buffer; void CDC1_OnError(byte error) { #if 0 if (error==CDC1_USB_ERR_RX_PUT) { /* not enough space in input buffer */ (void)Rx1_Get(&nRX_Buffer); /* free up some space in Rx buffer */ } #endif }