/********************************************************************** * Outline : USBCDC_WriteString * Description : Writes string. (BULK IN) * Blocks untill string has been written or error. * Note: As this is a blocking function it must not be * called from an interrupt with higher priority than * the USB interrupts. * Argument : -sz: String to write (NULL Terminated) * Return value : Error code. **********************************************************************/ USB_ERR USBCDC_WriteString(const char* const _sz) { USB_ERR err = USB_ERR_OK; uint32_t NumBytes = (uint32_t)strlen(_sz); err = USBCDC_Write(NumBytes, (uint8_t*)_sz); return err; }
/********************************************************************** * Outline : USBCDC_PutChar * Description : Write 1 character (BULK IN). * Note: As this is a blocking function it must not be * called from an interrupt with higher priority than * the USB interrupts. * Argument : _Char: Byte to write. * Return value : Error code. **********************************************************************/ USB_ERR USBCDC_PutChar(uint8_t _Char) { return USBCDC_Write(1, &_Char); }