mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
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:
@@ -179,7 +179,7 @@ static void USB_Device_GetDescriptor(void)
|
||||
void* DescriptorPointer;
|
||||
uint16_t DescriptorSize;
|
||||
|
||||
#if defined(USE_INTERNAL_SERIAL)
|
||||
#if !defined(NO_INTERNAL_SERIAL) && (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
|
||||
if (USB_ControlRequest.wValue == ((DTYPE_String << 8) | USE_INTERNAL_SERIAL))
|
||||
{
|
||||
uint8_t SignatureDescriptor[2 + (sizeof(int16_t) * 12)];
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user