Added USE_INTERNAL_SERIAL compile time option to automatically read out the internal...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / DevChapter9.h
index 68cb2c4..65fa041 100644 (file)
@@ -35,6 +35,9 @@
                #include <avr/io.h>\r
                #include <avr/pgmspace.h>\r
                #include <avr/eeprom.h>\r
+               #include <avr/boot.h>\r
+               #include <stdlib.h>\r
+               #include <ctype.h>\r
                \r
                #include "../HighLevel/StdDescriptors.h"\r
                #include "../HighLevel/Events.h"\r
                #include "../HighLevel/USBTask.h"\r
                #include "LowLevel.h"\r
 \r
+       /* Preprocessor Checks: */\r
+               #if defined(USE_INTERNAL_SERIAL) && !(defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))\r
+                       #error USE_INTERNAL_SERIAL invalid, the selected AVR model does not contain unique serial bytes.\r
+               #endif\r
+               \r
+               #if defined(USE_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL <= 1)\r
+                       #error USE_INTERNAL_SERIAL must be defined to the string descriptor index chosen for the serial number descriptor.\r
+               #endif\r
+\r
        /* Enable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                        extern "C" {\r