From 6865a7bc09e31d3bbebb33eefb6475c8713351bd Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Wed, 22 Apr 2009 13:30:03 +0000
Subject: [PATCH] Applied STATIC_ENDPOINT_CONFIGURATION and FIXED_CONTROL_SIZE
 tokens to all Device mode demos to reduce binary size.

---
 Bootloaders/TeensyHID/Descriptors.c      | 2 +-
 Demos/Device/AudioInput/Descriptors.c    | 2 +-
 Demos/Device/AudioInput/makefile         | 1 +
 Demos/Device/AudioOutput/Descriptors.c   | 2 +-
 Demos/Device/AudioOutput/makefile        | 1 +
 Demos/Device/CDC/Descriptors.c           | 2 +-
 Demos/Device/CDC/makefile                | 1 +
 Demos/Device/DualCDC/Descriptors.c       | 2 +-
 Demos/Device/DualCDC/makefile            | 1 +
 Demos/Device/GenericHID/Descriptors.c    | 2 +-
 Demos/Device/GenericHID/makefile         | 1 +
 Demos/Device/Joystick/Descriptors.c      | 2 +-
 Demos/Device/Joystick/makefile           | 1 +
 Demos/Device/Keyboard/Descriptors.c      | 2 +-
 Demos/Device/Keyboard/makefile           | 1 +
 Demos/Device/KeyboardMouse/Descriptors.c | 2 +-
 Demos/Device/KeyboardMouse/makefile      | 1 +
 Demos/Device/MIDI/Descriptors.c          | 2 +-
 Demos/Device/MIDI/makefile               | 1 +
 Demos/Device/MassStorage/Descriptors.c   | 2 +-
 Demos/Device/MassStorage/makefile        | 1 +
 Demos/Device/Mouse/Descriptors.c         | 2 +-
 Demos/Device/Mouse/makefile              | 1 +
 Demos/Device/RNDISEthernet/Descriptors.c | 2 +-
 Demos/Device/RNDISEthernet/makefile      | 1 +
 Demos/Device/USBtoSerial/Descriptors.c   | 2 +-
 Demos/Device/USBtoSerial/makefile        | 1 +
 Projects/Magstripe/Descriptors.c         | 2 +-
 Projects/Magstripe/makefile              | 1 +
 29 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/Bootloaders/TeensyHID/Descriptors.c b/Bootloaders/TeensyHID/Descriptors.c
index 68b9c4306..508dfb73a 100644
--- a/Bootloaders/TeensyHID/Descriptors.c
+++ b/Bootloaders/TeensyHID/Descriptors.c
@@ -71,7 +71,7 @@ USB_Descriptor_Device_t DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x16C0,
 	.ProductID              = 0x0478,
diff --git a/Demos/Device/AudioInput/Descriptors.c b/Demos/Device/AudioInput/Descriptors.c
index eb9b32af4..0a0ef0205 100644
--- a/Demos/Device/AudioInput/Descriptors.c
+++ b/Demos/Device/AudioInput/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2047,
diff --git a/Demos/Device/AudioInput/makefile b/Demos/Device/AudioInput/makefile
index 31e609db6..19dc5e225 100644
--- a/Demos/Device/AudioInput/makefile
+++ b/Demos/Device/AudioInput/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/AudioOutput/Descriptors.c b/Demos/Device/AudioOutput/Descriptors.c
index 99b6802ed..9da69f198 100644
--- a/Demos/Device/AudioOutput/Descriptors.c
+++ b/Demos/Device/AudioOutput/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2046,
diff --git a/Demos/Device/AudioOutput/makefile b/Demos/Device/AudioOutput/makefile
index 997abe6af..b1a0511cd 100644
--- a/Demos/Device/AudioOutput/makefile
+++ b/Demos/Device/AudioOutput/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 CDEFS += -DAUDIO_OUT_STEREO
 
diff --git a/Demos/Device/CDC/Descriptors.c b/Demos/Device/CDC/Descriptors.c
index 41b6e4d22..6b65a760e 100644
--- a/Demos/Device/CDC/Descriptors.c
+++ b/Demos/Device/CDC/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2044,
diff --git a/Demos/Device/CDC/makefile b/Demos/Device/CDC/makefile
index d9df583d4..fe839d6e2 100644
--- a/Demos/Device/CDC/makefile
+++ b/Demos/Device/CDC/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/DualCDC/Descriptors.c b/Demos/Device/DualCDC/Descriptors.c
index e5d7ee26c..d88fe98e7 100644
--- a/Demos/Device/DualCDC/Descriptors.c
+++ b/Demos/Device/DualCDC/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x02,
 	.Protocol               = 0x01,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x204E,
diff --git a/Demos/Device/DualCDC/makefile b/Demos/Device/DualCDC/makefile
index c45601254..9134f238c 100644
--- a/Demos/Device/DualCDC/makefile
+++ b/Demos/Device/DualCDC/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/GenericHID/Descriptors.c b/Demos/Device/GenericHID/Descriptors.c
index 9b87a0484..30b0c5365 100644
--- a/Demos/Device/GenericHID/Descriptors.c
+++ b/Demos/Device/GenericHID/Descriptors.c
@@ -77,7 +77,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x204F,
diff --git a/Demos/Device/GenericHID/makefile b/Demos/Device/GenericHID/makefile
index 4972121bc..3cf807011 100644
--- a/Demos/Device/GenericHID/makefile
+++ b/Demos/Device/GenericHID/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 # Place -D or -U options here for ASM sources
diff --git a/Demos/Device/Joystick/Descriptors.c b/Demos/Device/Joystick/Descriptors.c
index 81071a6a3..8567aede1 100644
--- a/Demos/Device/Joystick/Descriptors.c
+++ b/Demos/Device/Joystick/Descriptors.c
@@ -87,7 +87,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2043,
diff --git a/Demos/Device/Joystick/makefile b/Demos/Device/Joystick/makefile
index dd4495447..5230af222 100644
--- a/Demos/Device/Joystick/makefile
+++ b/Demos/Device/Joystick/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/Keyboard/Descriptors.c b/Demos/Device/Keyboard/Descriptors.c
index 1c99813f2..8d60bd8ad 100644
--- a/Demos/Device/Keyboard/Descriptors.c
+++ b/Demos/Device/Keyboard/Descriptors.c
@@ -94,7 +94,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2042,
diff --git a/Demos/Device/Keyboard/makefile b/Demos/Device/Keyboard/makefile
index 945a6f8fc..68271f777 100644
--- a/Demos/Device/Keyboard/makefile
+++ b/Demos/Device/Keyboard/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 # Place -D or -U options here for ASM sources
diff --git a/Demos/Device/KeyboardMouse/Descriptors.c b/Demos/Device/KeyboardMouse/Descriptors.c
index b5bc15ae6..0b13ac409 100644
--- a/Demos/Device/KeyboardMouse/Descriptors.c
+++ b/Demos/Device/KeyboardMouse/Descriptors.c
@@ -127,7 +127,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x204D,
diff --git a/Demos/Device/KeyboardMouse/makefile b/Demos/Device/KeyboardMouse/makefile
index e11238c17..000dba261 100644
--- a/Demos/Device/KeyboardMouse/makefile
+++ b/Demos/Device/KeyboardMouse/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/MIDI/Descriptors.c b/Demos/Device/MIDI/Descriptors.c
index 41502238c..7b819cb32 100644
--- a/Demos/Device/MIDI/Descriptors.c
+++ b/Demos/Device/MIDI/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2048,
diff --git a/Demos/Device/MIDI/makefile b/Demos/Device/MIDI/makefile
index 08c303ec0..d7d28e8d9 100644
--- a/Demos/Device/MIDI/makefile
+++ b/Demos/Device/MIDI/makefile
@@ -185,6 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/MassStorage/Descriptors.c b/Demos/Device/MassStorage/Descriptors.c
index 3592e9da6..b4297eb37 100644
--- a/Demos/Device/MassStorage/Descriptors.c
+++ b/Demos/Device/MassStorage/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2045,
diff --git a/Demos/Device/MassStorage/makefile b/Demos/Device/MassStorage/makefile
index f263c5a7b..9ef390db8 100644
--- a/Demos/Device/MassStorage/makefile
+++ b/Demos/Device/MassStorage/makefile
@@ -187,6 +187,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Demos/Device/Mouse/Descriptors.c b/Demos/Device/Mouse/Descriptors.c
index 858a562ac..40ad01c76 100644
--- a/Demos/Device/Mouse/Descriptors.c
+++ b/Demos/Device/Mouse/Descriptors.c
@@ -87,7 +87,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2041,
diff --git a/Demos/Device/Mouse/makefile b/Demos/Device/Mouse/makefile
index b788b5a73..79e16e3ec 100644
--- a/Demos/Device/Mouse/makefile
+++ b/Demos/Device/Mouse/makefile
@@ -184,6 +184,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 # Place -D or -U options here for ASM sources
diff --git a/Demos/Device/RNDISEthernet/Descriptors.c b/Demos/Device/RNDISEthernet/Descriptors.c
index 46c3be1ec..1e084be03 100644
--- a/Demos/Device/RNDISEthernet/Descriptors.c
+++ b/Demos/Device/RNDISEthernet/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x204C,
diff --git a/Demos/Device/RNDISEthernet/makefile b/Demos/Device/RNDISEthernet/makefile
index 845c20873..33b37cfc9 100644
--- a/Demos/Device/RNDISEthernet/makefile
+++ b/Demos/Device/RNDISEthernet/makefile
@@ -197,6 +197,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP
diff --git a/Demos/Device/USBtoSerial/Descriptors.c b/Demos/Device/USBtoSerial/Descriptors.c
index 1619f9d57..3e2f37993 100644
--- a/Demos/Device/USBtoSerial/Descriptors.c
+++ b/Demos/Device/USBtoSerial/Descriptors.c
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2044,
diff --git a/Demos/Device/USBtoSerial/makefile b/Demos/Device/USBtoSerial/makefile
index 8b7e70163..94f23143b 100644
--- a/Demos/Device/USBtoSerial/makefile
+++ b/Demos/Device/USBtoSerial/makefile
@@ -186,6 +186,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 
diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c
index 819b48892..785f84951 100644
--- a/Projects/Magstripe/Descriptors.c
+++ b/Projects/Magstripe/Descriptors.c
@@ -85,7 +85,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 	.SubClass               = 0x00,
 	.Protocol               = 0x00,
 				
-	.Endpoint0Size          = 8,
+	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 		
 	.VendorID               = 0x03EB,
 	.ProductID              = 0x2042,
diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile
index 979952d42..8006b0cda 100644
--- a/Projects/Magstripe/makefile
+++ b/Projects/Magstripe/makefile
@@ -186,6 +186,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 
 CDEFS += -DMAG_T1_CLOCK="(1 << 0)"
-- 
GitLab