Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number, added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code. Updated Mass Storage and CDC based demos to use the new device serial number if the device it is compiled for supports it.

This commit is contained in:
Dean Camera 2009-06-21 09:22:31 +00:00
parent 9d506553aa
commit 730624f745
9 changed files with 34 additions and 46 deletions

View file

@ -45,21 +45,12 @@
#include "../HighLevel/USBTask.h"
#include "LowLevel.h"
/* Preprocessor Checks: */
#if defined(USE_INTERNAL_SERIAL) && !(defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
#error USE_INTERNAL_SERIAL invalid, the selected AVR model does not contain unique serial bytes.
#endif
#if defined(USE_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL <= 1)
#error USE_INTERNAL_SERIAL must be defined to the string descriptor index chosen for the serial number descriptor.
#endif
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Public Interface - May be used in end-application: */
/* Public Interface - May be used in end-application: */
/* Global Variables: */
/** Indicates the currently set configuration number of the device. USB devices may have several
* different configurations which the host can select between; this indicates the currently selected