Tags:
create new tag
, view all tags

Includes

#include <stdio.h>
#include <stdarg.h>

USB Initialization

// Initialize USB
USB_Start(0,USB_DWR_VDDD_OPERATION);

print() Function

// print() function, works like snprintf(). See: http://www.cplusplus.com/reference/cstdio/snprintf/
void print(const char *fmt, ...)
{
   if(!USB_GetConfiguration()) return;  // Do nothing if the USB cable is not connected.
   char buffer[64];
   va_list args;
   va_start(args, fmt);
   vsnprintf(buffer, sizeof(buffer), fmt, args);
   va_end(args);
   while(!USB_CDCIsReady());
   USB_PutString(buffer);
}
Topic revision: r5 - 2015-07-22 - AhmetSekercioglu
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback