Added USE_INTERNAL_SERIAL compile time option to automatically read out the internal unique serial number as the device's serial number descriptor on supported AVR models.
This commit is contained in:
parent
35bdada24b
commit
00d0883507
12 changed files with 142 additions and 38 deletions
|
@ -35,6 +35,9 @@
|
|||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include <avr/eeprom.h>
|
||||
#include <avr/boot.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../HighLevel/StdDescriptors.h"
|
||||
#include "../HighLevel/Events.h"
|
||||
|
@ -42,6 +45,15 @@
|
|||
#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" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue