diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index 87cc5c7921..83f3808945 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -121,7 +121,6 @@ LUFA_PATH = ../.. # LUFA library compile-time options LUFA_OPTS = -D USB_DEVICE_ONLY -LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index 622290ff3e..0a1e02ea2a 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -121,7 +121,6 @@ LUFA_PATH = ../.. # LUFA library compile-time options LUFA_OPTS = -D USB_DEVICE_ONLY -LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D CONTROL_ONLY_DEVICE LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=32 diff --git a/Bootloaders/TeensyHID/makefile b/Bootloaders/TeensyHID/makefile index 15d1d9dffc..1eec1f9aee 100644 --- a/Bootloaders/TeensyHID/makefile +++ b/Bootloaders/TeensyHID/makefile @@ -121,7 +121,6 @@ LUFA_PATH = ../.. # LUFA library compile-time options LUFA_OPTS = -D USB_DEVICE_ONLY -LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS += -D CONTROL_ONLY_DEVICE LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 diff --git a/Demos/Device/ClassDriver/AudioInput/makefile b/Demos/Device/ClassDriver/AudioInput/makefile index d68fb10df9..17514384ef 100644 --- a/Demos/Device/ClassDriver/AudioInput/makefile +++ b/Demos/Device/ClassDriver/AudioInput/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/ClassDriver/AudioOutput/makefile b/Demos/Device/ClassDriver/AudioOutput/makefile index 9940103e36..ec60801be8 100644 --- a/Demos/Device/ClassDriver/AudioOutput/makefile +++ b/Demos/Device/ClassDriver/AudioOutput/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/ClassDriver/CDC/makefile b/Demos/Device/ClassDriver/CDC/makefile index 996ec418d9..4aec962b9b 100644 --- a/Demos/Device/ClassDriver/CDC/makefile +++ b/Demos/Device/ClassDriver/CDC/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/DualCDC/makefile b/Demos/Device/ClassDriver/DualCDC/makefile index 0f2f415074..f3750170af 100644 --- a/Demos/Device/ClassDriver/DualCDC/makefile +++ b/Demos/Device/ClassDriver/DualCDC/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/GenericHID/makefile b/Demos/Device/ClassDriver/GenericHID/makefile index bf5e411930..17037623aa 100644 --- a/Demos/Device/ClassDriver/GenericHID/makefile +++ b/Demos/Device/ClassDriver/GenericHID/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/Joystick/makefile b/Demos/Device/ClassDriver/Joystick/makefile index 10051d70cb..2915b97b44 100644 --- a/Demos/Device/ClassDriver/Joystick/makefile +++ b/Demos/Device/ClassDriver/Joystick/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/Keyboard/makefile b/Demos/Device/ClassDriver/Keyboard/makefile index d9e805aa01..5f06d18120 100644 --- a/Demos/Device/ClassDriver/Keyboard/makefile +++ b/Demos/Device/ClassDriver/Keyboard/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/KeyboardMouse/makefile b/Demos/Device/ClassDriver/KeyboardMouse/makefile index a02e34dd54..aaaa6e72e4 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/makefile +++ b/Demos/Device/ClassDriver/KeyboardMouse/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/MIDI/makefile b/Demos/Device/ClassDriver/MIDI/makefile index dd150d6ce5..d9a0d23a19 100644 --- a/Demos/Device/ClassDriver/MIDI/makefile +++ b/Demos/Device/ClassDriver/MIDI/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/MassStorage/makefile b/Demos/Device/ClassDriver/MassStorage/makefile index 34d76a977d..cac929c233 100644 --- a/Demos/Device/ClassDriver/MassStorage/makefile +++ b/Demos/Device/ClassDriver/MassStorage/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/Mouse/makefile b/Demos/Device/ClassDriver/Mouse/makefile index 3664e8c4d5..62f3a6913a 100644 --- a/Demos/Device/ClassDriver/Mouse/makefile +++ b/Demos/Device/ClassDriver/Mouse/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/RNDISEthernet/makefile b/Demos/Device/ClassDriver/RNDISEthernet/makefile index 84a39327a8..a2ee1d86b8 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/makefile +++ b/Demos/Device/ClassDriver/RNDISEthernet/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/ClassDriver/USBtoSerial/makefile b/Demos/Device/ClassDriver/USBtoSerial/makefile index ea45d066f6..da62fa6201 100644 --- a/Demos/Device/ClassDriver/USBtoSerial/makefile +++ b/Demos/Device/ClassDriver/USBtoSerial/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/Incomplete/Sideshow/makefile b/Demos/Device/Incomplete/Sideshow/makefile index 6ceafa1a75..c1b38ff235 100644 --- a/Demos/Device/Incomplete/Sideshow/makefile +++ b/Demos/Device/Incomplete/Sideshow/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/AudioInput/makefile b/Demos/Device/LowLevel/AudioInput/makefile index 06703c0e17..fa2f7bc518 100644 --- a/Demos/Device/LowLevel/AudioInput/makefile +++ b/Demos/Device/LowLevel/AudioInput/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/AudioOutput/makefile b/Demos/Device/LowLevel/AudioOutput/makefile index 611472058a..606c5b77fb 100644 --- a/Demos/Device/LowLevel/AudioOutput/makefile +++ b/Demos/Device/LowLevel/AudioOutput/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/CDC/makefile b/Demos/Device/LowLevel/CDC/makefile index 8132582491..f69c1caae3 100644 --- a/Demos/Device/LowLevel/CDC/makefile +++ b/Demos/Device/LowLevel/CDC/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/DualCDC/makefile b/Demos/Device/LowLevel/DualCDC/makefile index 87c4ca8a71..629d7d57ba 100644 --- a/Demos/Device/LowLevel/DualCDC/makefile +++ b/Demos/Device/LowLevel/DualCDC/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/GenericHID/makefile b/Demos/Device/LowLevel/GenericHID/makefile index 6f5a6e4160..e1f407c0c7 100644 --- a/Demos/Device/LowLevel/GenericHID/makefile +++ b/Demos/Device/LowLevel/GenericHID/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/Joystick/makefile b/Demos/Device/LowLevel/Joystick/makefile index b23c15b13d..88057eb200 100644 --- a/Demos/Device/LowLevel/Joystick/makefile +++ b/Demos/Device/LowLevel/Joystick/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/Keyboard/makefile b/Demos/Device/LowLevel/Keyboard/makefile index 0561df2514..09d0d57f36 100644 --- a/Demos/Device/LowLevel/Keyboard/makefile +++ b/Demos/Device/LowLevel/Keyboard/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/KeyboardMouse/makefile b/Demos/Device/LowLevel/KeyboardMouse/makefile index e7aae35ce7..bb391e2784 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/makefile +++ b/Demos/Device/LowLevel/KeyboardMouse/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/MIDI/makefile b/Demos/Device/LowLevel/MIDI/makefile index 66843cd3b4..e8c675c1f0 100644 --- a/Demos/Device/LowLevel/MIDI/makefile +++ b/Demos/Device/LowLevel/MIDI/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/MassStorage/makefile b/Demos/Device/LowLevel/MassStorage/makefile index 954324f17a..5a23ad0485 100644 --- a/Demos/Device/LowLevel/MassStorage/makefile +++ b/Demos/Device/LowLevel/MassStorage/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Demos/Device/LowLevel/Mouse/makefile b/Demos/Device/LowLevel/Mouse/makefile index 3eec080fdf..865bdcaed5 100644 --- a/Demos/Device/LowLevel/Mouse/makefile +++ b/Demos/Device/LowLevel/Mouse/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/RNDISEthernet/makefile b/Demos/Device/LowLevel/RNDISEthernet/makefile index c6d8306c99..caa48651bf 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/makefile +++ b/Demos/Device/LowLevel/RNDISEthernet/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Device/LowLevel/USBtoSerial/makefile b/Demos/Device/LowLevel/USBtoSerial/makefile index 324367ae1d..c607d5e977 100644 --- a/Demos/Device/LowLevel/USBtoSerial/makefile +++ b/Demos/Device/LowLevel/USBtoSerial/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 diff --git a/Demos/Host/ClassDriver/CDCHost/makefile b/Demos/Host/ClassDriver/CDCHost/makefile index db62b2ec06..9163fd0874 100644 --- a/Demos/Host/ClassDriver/CDCHost/makefile +++ b/Demos/Host/ClassDriver/CDCHost/makefile @@ -116,7 +116,6 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/ClassDriver/MassStorageHost/makefile b/Demos/Host/ClassDriver/MassStorageHost/makefile index 42bbff874c..a046778fe1 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/makefile +++ b/Demos/Host/ClassDriver/MassStorageHost/makefile @@ -116,9 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/ClassDriver/MouseHost/makefile b/Demos/Host/ClassDriver/MouseHost/makefile index 03bcf30f5a..5d1d953192 100644 --- a/Demos/Host/ClassDriver/MouseHost/makefile +++ b/Demos/Host/ClassDriver/MouseHost/makefile @@ -116,9 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS += -D USB_HOST_ONLY -LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/ClassDriver/StillImageHost/makefile b/Demos/Host/ClassDriver/StillImageHost/makefile index 626d6e6858..def72a9988 100644 --- a/Demos/Host/ClassDriver/StillImageHost/makefile +++ b/Demos/Host/ClassDriver/StillImageHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile index 019554293e..3ae74d4d95 100644 --- a/Demos/Host/Incomplete/BluetoothHost/makefile +++ b/Demos/Host/Incomplete/BluetoothHost/makefile @@ -123,8 +123,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/CDCHost/makefile b/Demos/Host/LowLevel/CDCHost/makefile index 282915fa9b..7cc95745bc 100644 --- a/Demos/Host/LowLevel/CDCHost/makefile +++ b/Demos/Host/LowLevel/CDCHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/GenericHIDHost/makefile b/Demos/Host/LowLevel/GenericHIDHost/makefile index bc474604d5..6e0641156e 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/makefile +++ b/Demos/Host/LowLevel/GenericHIDHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/KeyboardHost/makefile b/Demos/Host/LowLevel/KeyboardHost/makefile index 072ca25065..d6d6358401 100644 --- a/Demos/Host/LowLevel/KeyboardHost/makefile +++ b/Demos/Host/LowLevel/KeyboardHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile index 1ec8d47540..5561ac7d3c 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/MassStorageHost/makefile b/Demos/Host/LowLevel/MassStorageHost/makefile index 96242749e7..63b1db3b45 100644 --- a/Demos/Host/LowLevel/MassStorageHost/makefile +++ b/Demos/Host/LowLevel/MassStorageHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=2000 diff --git a/Demos/Host/LowLevel/MouseHost/makefile b/Demos/Host/LowLevel/MouseHost/makefile index 1f95516309..19be8d110d 100644 --- a/Demos/Host/LowLevel/MouseHost/makefile +++ b/Demos/Host/LowLevel/MouseHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/MouseHostWithParser/makefile b/Demos/Host/LowLevel/MouseHostWithParser/makefile index 241563f679..8cf9d43f9c 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/makefile +++ b/Demos/Host/LowLevel/MouseHostWithParser/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/PrinterHost/makefile b/Demos/Host/LowLevel/PrinterHost/makefile index 8e28bdaf18..b9f0eb575d 100644 --- a/Demos/Host/LowLevel/PrinterHost/makefile +++ b/Demos/Host/LowLevel/PrinterHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_HOST_ONLY +LUFA_OPTS = -D USB_HOST_ONLY LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/Host/LowLevel/StillImageHost/makefile b/Demos/Host/LowLevel/StillImageHost/makefile index 583f7cfc81..64bf730d26 100644 --- a/Demos/Host/LowLevel/StillImageHost/makefile +++ b/Demos/Host/LowLevel/StillImageHost/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" diff --git a/Demos/OTG/TestApp/makefile b/Demos/OTG/TestApp/makefile index 2935bafb55..7cf4e6e740 100644 --- a/Demos/OTG/TestApp/makefile +++ b/Demos/OTG/TestApp/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USE_FLASH_DESCRIPTORS +LUFA_OPTS = -D USE_FLASH_DESCRIPTORS # List C source files here. (C dependencies are automatically generated.) diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 68dddeacb2..4a4d88461a 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -50,12 +50,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint return CDC_ENUMERROR_NoCDCInterfaceFound; } - CDCInterfaceInfo->State.ControlInterfaceNumber = -#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) - DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber; -#else - DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).bInterfaceNumber; -#endif + CDCInterfaceInfo->State.ControlInterfaceNumber = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber; while (FoundEndpoints != (CDC_FOUND_NOTIFICATION_IN | CDC_FOUND_DATAPIPE_IN | CDC_FOUND_DATAPIPE_OUT)) { @@ -259,7 +254,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* CDCInterfa uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length) { if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) - return; + return PIPE_READYWAIT_NoError; uint8_t ErrorCode; @@ -274,7 +269,7 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Da uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data) { if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) - return; + return PIPE_READYWAIT_NoError;; uint8_t ErrorCode; diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 15106cee1d..11dfb67adc 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -60,14 +60,16 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint } while (HIDInterfaceInfo->Config.HIDInterfaceProtocol && (CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol)); - HIDInterfaceInfo->State.InterfaceNumber = - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) - CurrentHIDInterface->InterfaceNumber; - #else - CurrentHIDInterface->bInterfaceNumber; - #endif + HIDInterfaceInfo->State.InterfaceNumber = CurrentHIDInterface->InterfaceNumber; HIDInterfaceInfo->State.SupportsBootSubClass = (CurrentHIDInterface->SubClass != 0); + if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DComp_NextHID) != DESCRIPTOR_SEARCH_COMP_Found) + { + return HID_ENUMERROR_NoHIDDescriptorFound; + } + + HIDInterfaceInfo->State.HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_HID_Descriptor_t).HIDReportLength; + while (FoundEndpoints != (HID_FOUND_DATAPIPE_IN | HID_FOUND_DATAPIPE_OUT)) { if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, @@ -117,6 +119,16 @@ static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } +static uint8_t DComp_NextHID(void* CurrentDescriptor) +{ + if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID) + return DESCRIPTOR_SEARCH_Found; + else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) + return DESCRIPTOR_SEARCH_Fail; + else + return DESCRIPTOR_SEARCH_NotFound; +} + static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) @@ -170,6 +182,9 @@ uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, boo Pipe_SelectPipe(PIPE_CONTROLPIPE); + if (UseReportProtocol && !(HIDInterfaceInfo->State.SupportsBootSubClass)) + return MS_ERROR_UNSUPPORTED; + return USB_Host_SendControlRequest(NULL); } diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index dd4a7537fa..c1a68f819b 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -55,6 +55,10 @@ #endif /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Error code for some HID Host functions, indicating a logical (and not hardware) error */ + #define MS_ERROR_UNSUPPORTED 0xC0 + /* Type Defines: */ /** Class state structure. An instance of this structure should be made within the user application, * and passed to each of the HID class driver functions as the HIDInterfaceInfo parameter. This @@ -71,6 +75,8 @@ * boot subclass protocol is required (e.g. keyboard, mouse), or * leave as 0 to match against the first HID interface found */ + HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol + * is not used */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * must be set or the interface will fail to enumerate and operate correctly. */ @@ -88,6 +94,7 @@ bool SupportsBootSubClass; /**< Indicates if the current interface instance supports the HID Boot * Protocol when enabled via \ref USB_HID_Host_SetProtocol() */ + uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device */ } State; /**< State data for the USB class interface within the device. All elements in this section * may be set to initial values, but may also be ignored to default to sane values when * the interface is enumerated. @@ -100,7 +107,8 @@ HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */ HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */ HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */ - HID_ENUMERROR_EndpointsNotFound = 3, /**< Compatible HID endpoints were not found in the device's HID interface */ + HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface */ + HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface */ }; /* Function Prototypes: */ @@ -109,6 +117,7 @@ uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); + uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, bool UseReportProtocol) ATTR_NON_NULL_PTR_ARG(1); /* Private Interface - For use in library only: */ @@ -122,6 +131,7 @@ /* Function Prototypes: */ #if defined(INCLUDE_FROM_HID_CLASS_HOST_C) static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); + static uint8_t DComp_NextHID(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); #endif #endif diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index a812fa9759..2d2f042b71 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -50,12 +50,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_ return MS_ENUMERROR_NoMSInterfaceFound; } - MSInterfaceInfo->State.InterfaceNumber = - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) - DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber; - #else - DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->bInterfaceNumber; - #endif + MSInterfaceInfo->State.InterfaceNumber = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber; while (FoundEndpoints != (MS_FOUND_DATAPIPE_IN | MS_FOUND_DATAPIPE_OUT)) { @@ -150,7 +145,8 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, MS_ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber); Pipe_Unfreeze(); - if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t))) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t), + NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearOUT(); @@ -238,7 +234,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); Pipe_Unfreeze(); - if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearIN(); @@ -248,7 +244,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber); Pipe_Unfreeze(); - if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearOUT(); @@ -276,7 +272,8 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* MSInterfaceInf Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); Pipe_Unfreeze(); - if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t))) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t), + NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearIN(); diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index ff2e9019ee..f6a1b61c2c 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -55,6 +55,7 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ + /** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error */ #define MS_ERROR_LOGICAL_CMD_FAILED 0xC0 /* Type Defines: */ diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index 0e14469785..66dc3925c1 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -55,6 +55,7 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ + /** Error code for some Still Image Host functions, indicating a logical (and not hardware) error */ #define SI_ERROR_LOGICAL_CMD_FAILED 0xC0 /* Type Defines: */ @@ -134,7 +135,7 @@ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * returned a logical command failure */ - uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); + uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); /** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated * PIMA commands have been issued to the device. @@ -144,7 +145,7 @@ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * returned a logical command failure */ - uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); + uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); /** Sends a given PIMA command to the attached device, filling out the PIMA command header automatically as required. * @@ -157,7 +158,7 @@ * returned a logical command failure */ uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t Operation, uint8_t TotalParams, - uint32_t* Params); + uint32_t* Params) ATTR_NON_NULL_PTR_ARG(1); /** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data * associated with the command has been transferred. @@ -167,7 +168,7 @@ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * returned a logical command failure */ - uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); + uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); /** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe. * @@ -175,7 +176,7 @@ * * \return Boolean true if an event is waiting to be read, false otherwise */ - bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); + bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); /** Receives an asynchronous event block from the device via the asynchronous events pipe. * @@ -186,7 +187,7 @@ * returned a logical command failure */ uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, - SI_PIMA_Container_t* PIMAHeader); + SI_PIMA_Container_t* PIMAHeader) ATTR_NON_NULL_PTR_ARG(1, 2); /** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data * transfer beyond the regular PIMA command block parameters. @@ -197,7 +198,7 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum */ - uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes); + uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1, 2); /** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data * transfer beyond the regular PIMA command block parameters. @@ -208,7 +209,7 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum */ - uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes); + uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1, 2); /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c index 4c6fbfdabe..6b20f46426 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c @@ -51,11 +51,7 @@ uint8_t USB_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const Conf if ((ErrorCode = USB_Host_SendControlRequest(ConfigHeader)) != HOST_SENDCONTROL_Successful) return ErrorCode; - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) *ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).TotalConfigurationSize; - #else - *ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).wTotalLength; - #endif if (*ConfigSizePtr > BufferSize) return HOST_GETCONFIG_BuffOverflow; diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h index 9f7b1f60a9..be24debbab 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h @@ -98,18 +98,10 @@ * This value's meaning depends on the descriptor's placement in the descriptor, but standard type * values can be accessed in the \ref USB_DescriptorTypes_t enum. */ - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) - #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type - #else - #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bDescriptorType - #endif + #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type /** Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes. */ - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) - #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size - #else - #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength - #endif + #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size /* Type Defines: */ /** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array @@ -268,11 +260,7 @@ static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, uint8_t** const CurrConfigLoc) { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size; - #else - uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).bLength; - #endif *CurrConfigLoc += CurrDescriptorSize; *BytesRem -= CurrDescriptorSize; diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h index 0e0d1e9f49..0b56ab6d08 100644 --- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h +++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h @@ -34,16 +34,6 @@ * Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains * structures and macros for the easy creation of standard USB descriptors in USB device projects. * - * All standard descriptors have their elements named in an identical manner to the official USB specification, - * however slightly more verbose alternate (non-standard) names are also supplied if the macro - * USE_NONSTANDARD_DESCRIPTOR_NAMES is defined in the user project makefile and passed to the compiler at - * compilation time using the -D option. - * - * The non-standard names are documented here - if USE_NONSTANDARD_DESCRIPTOR_NAMES is not defined, then all - * descriptors will contain elements named identically to the official USB specification. The alternately - * named descriptor elements are placed in the same order inside the descriptor structures as their officially - * named counterparts, thus they can be correlated easily with the official USB specification. - * * @{ */ @@ -206,170 +196,232 @@ }; /* Type Defines: */ - /** Type define for all descriptor's header, indicating the descriptor's length and type. + /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure + * uses LUFA-specific element names to make each element's purpose clearer. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * \see \ref USB_StdDescriptor_Header_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) - uint8_t Size; /**< Size of the descriptor, in bytes. */ - uint8_t Type; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value - * given by the specific class. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - #endif + uint8_t Size; /**< Size of the descriptor, in bytes. */ + uint8_t Type; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ } USB_Descriptor_Header_t; - /** Type define for a standard device descriptor. + /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure + * uses the relevant standard's given element names to ensure compatibility with the standard. + * + * \see \ref USB_Descriptor_Header_t for the version of this define with non-standard LUFA specific element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + } USB_StdDescriptor_Header_t; + + /** Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each + * element's purpose clearer. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * \see \ref USB_StdDescriptor_Device_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - uint16_t USBSpecification; /**< BCD of the supported USB specification. */ - uint8_t Class; /**< USB device class. */ - uint8_t SubClass; /**< USB device subclass. */ - uint8_t Protocol; /**< USB device protocol. */ + uint16_t USBSpecification; /**< BCD of the supported USB specification. */ + uint8_t Class; /**< USB device class. */ + uint8_t SubClass; /**< USB device subclass. */ + uint8_t Protocol; /**< USB device protocol. */ - uint8_t Endpoint0Size; /**< Size of the control (address 0) endpoint's bank in bytes. */ + uint8_t Endpoint0Size; /**< Size of the control (address 0) endpoint's bank in bytes. */ - uint16_t VendorID; /**< Vendor ID for the USB product. */ - uint16_t ProductID; /**< Unique product ID for the USB product. */ - uint16_t ReleaseNumber; /**< Product release (version) number. */ + uint16_t VendorID; /**< Vendor ID for the USB product. */ + uint16_t ProductID; /**< Unique product ID for the USB product. */ + uint16_t ReleaseNumber; /**< Product release (version) number. */ - uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The - * host will request this string via a separate - * control request for the string descriptor. - * - * \note If no string supplied, use \ref NO_DESCRIPTOR. - */ - uint8_t ProductStrIndex; /**< String index for the product name/details. - * - * \see ManufacturerStrIndex structure entry. - */ - uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal - * serial number, in uppercase Unicode ASCII. - * - * \note On some AVR models, there is an embedded serial number - * in the chip which can be used for the device serial number. - * To use this serial number, set this to USE_INTERNAL_SERIAL. - * On unsupported devices, this will evaluate to 0 and will cause - * the host to generate a pseudo-unique value for the device upon - * insertion. - * - * \see ManufacturerStrIndex structure entry. - */ - - uint8_t NumberOfConfigurations; /**< Total number of configurations supported by - * the device. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice; - uint8_t iManufacturer; - uint8_t iProduct; - uint8_t iSerialNumber; - uint8_t bNumConfigurations; - #endif + uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The + * host will request this string via a separate + * control request for the string descriptor. + * + * \note If no string supplied, use \ref NO_DESCRIPTOR. + */ + uint8_t ProductStrIndex; /**< String index for the product name/details. + * + * \see ManufacturerStrIndex structure entry. + */ + uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal + * serial number, in uppercase Unicode ASCII. + * + * \note On some AVR models, there is an embedded serial number + * in the chip which can be used for the device serial number. + * To use this serial number, set this to USE_INTERNAL_SERIAL. + * On unsupported devices, this will evaluate to 0 and will cause + * the host to generate a pseudo-unique value for the device upon + * insertion. + * + * \see ManufacturerStrIndex structure entry. + */ + uint8_t NumberOfConfigurations; /**< Total number of configurations supported by + * the device. + */ } USB_Descriptor_Device_t; - /** Type define for a standard configuration descriptor. + /** Type define for a standard Device Descriptor. This structure uses the relevant standard's given element names + * to ensure compatibility with the standard. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + uint16_t bcdUSB; /**< BCD of the supported USB specification. */ + uint8_t bDeviceClass; /**< USB device class. */ + uint8_t bDeviceSubClass; /**< USB device subclass. */ + uint8_t bDeviceProtocol; /**< USB device protocol. */ + uint8_t bMaxPacketSize0; /**< Size of the control (address 0) endpoint's bank in bytes. */ + uint16_t idVendor; /**< Vendor ID for the USB product. */ + uint16_t idProduct; /**< Unique product ID for the USB product. */ + uint16_t bcdDevice; /**< Product release (version) number. */ + uint8_t iManufacturer; /**< String index for the manufacturer's name. The + * host will request this string via a separate + * control request for the string descriptor. + * + * \note If no string supplied, use \ref NO_DESCRIPTOR. + */ + uint8_t iProduct; /**< String index for the product name/details. + * + * \see ManufacturerStrIndex structure entry. + */ + uint8_t iSerialNumber; /**< String index for the product's globally unique hexadecimal + * serial number, in uppercase Unicode ASCII. + * + * \note On some AVR models, there is an embedded serial number + * in the chip which can be used for the device serial number. + * To use this serial number, set this to USE_INTERNAL_SERIAL. + * On unsupported devices, this will evaluate to 0 and will cause + * the host to generate a pseudo-unique value for the device upon + * insertion. + * + * \see ManufacturerStrIndex structure entry. + */ + uint8_t bNumConfigurations; /**< Total number of configurations supported by + * the device. + */ + } USB_StdDescriptor_Device_t; + + /** Type define for a standard Configuration Descriptor header. This structure uses LUFA-specific element names + * to make each element's purpose clearer. + * + * \see \ref USB_StdDescriptor_Configuration_Header_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header, - * and all sub descriptors inside the configuration. - */ - uint8_t TotalInterfaces; /**< Total number of interfaces in the configuration. */ + uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header, + * and all sub descriptors inside the configuration. + */ + uint8_t TotalInterfaces; /**< Total number of interfaces in the configuration. */ - uint8_t ConfigurationNumber; /**< Configuration index of the current configuration. */ - uint8_t ConfigurationStrIndex; /**< Index of a string descriptor describing the configuration. */ + uint8_t ConfigurationNumber; /**< Configuration index of the current configuration. */ + uint8_t ConfigurationStrIndex; /**< Index of a string descriptor describing the configuration. */ - uint8_t ConfigAttributes; /**< Configuration attributes, comprised of a mask of zero or - * more USB_CONFIG_ATTR_* masks. - */ + uint8_t ConfigAttributes; /**< Configuration attributes, comprised of a mask of zero or + * more USB_CONFIG_ATTR_* masks. + */ - uint8_t MaxPowerConsumption; /**< Maximum power consumption of the device while in the - * current configuration, calculated by the \ref USB_CONFIG_POWER_MA() - * macro. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t wTotalLength; - uint8_t bNumInterfaces; - uint8_t bConfigurationValue; - uint8_t iConfiguration; - uint8_t bmAttributes; - uint8_t bMaxPower; - #endif + uint8_t MaxPowerConsumption; /**< Maximum power consumption of the device while in the + * current configuration, calculated by the \ref USB_CONFIG_POWER_MA() + * macro. + */ } USB_Descriptor_Configuration_Header_t; - - /** Type define for a standard interface descriptor. + + /** Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names + * to ensure compatibility with the standard. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + uint16_t wTotalLength; /**< Size of the configuration descriptor header, + * and all sub descriptors inside the configuration. + */ + uint8_t bNumInterfaces; /**< Total number of interfaces in the configuration. */ + uint8_t bConfigurationValue; /**< Configuration index of the current configuration. */ + uint8_t iConfiguration; /**< Index of a string descriptor describing the configuration. */ + uint8_t bmAttributes; /**< Configuration attributes, comprised of a mask of zero or + * more USB_CONFIG_ATTR_* masks. + */ + uint8_t bMaxPower; /**< Maximum power consumption of the device while in the + * current configuration, calculated by the \ref USB_CONFIG_POWER_MA() + * macro. + */ + } USB_StdDescriptor_Configuration_Header_t; + + /** Type define for a standard Interface Descriptor. This structure uses LUFA-specific element names + * to make each element's purpose clearer. + * + * \see \ref USB_StdDescriptor_Interface_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - uint8_t InterfaceNumber; /**< Index of the interface in the current configuration. */ - uint8_t AlternateSetting; /**< Alternate setting for the interface number. The same - * interface number can have multiple alternate settings - * with different endpoint configurations, which can be - * selected by the host. - */ - uint8_t TotalEndpoints; /**< Total number of endpoints in the interface. */ + uint8_t InterfaceNumber; /**< Index of the interface in the current configuration. */ + uint8_t AlternateSetting; /**< Alternate setting for the interface number. The same + * interface number can have multiple alternate settings + * with different endpoint configurations, which can be + * selected by the host. + */ + uint8_t TotalEndpoints; /**< Total number of endpoints in the interface. */ - uint8_t Class; /**< Interface class ID. */ - uint8_t SubClass; /**< Interface subclass ID. */ - uint8_t Protocol; /**< Interface protocol ID. */ - - uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the - * interface. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bNumEndpoints; - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - uint8_t iInterface; - #endif - } USB_Descriptor_Interface_t; + uint8_t Class; /**< Interface class ID. */ + uint8_t SubClass; /**< Interface subclass ID. */ + uint8_t Protocol; /**< Interface protocol ID. */ - /** Type define for a standard Interface Association descriptor. + uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the + * interface. + */ + } USB_Descriptor_Interface_t; + + /** Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names + * to ensure compatibility with the standard. + * + * \see \ref USB_Descriptor_Interface_t for the version of this define with non-standard LUFA specific element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + uint8_t bInterfaceNumber; /**< Index of the interface in the current configuration. */ + uint8_t bAlternateSetting; /**< Alternate setting for the interface number. The same + * interface number can have multiple alternate settings + * with different endpoint configurations, which can be + * selected by the host. + */ + uint8_t bNumEndpoints; /**< Total number of endpoints in the interface. */ + uint8_t bInterfaceClass; /**< Interface class ID. */ + uint8_t bInterfaceSubClass; /**< Interface subclass ID. */ + uint8_t bInterfaceProtocol; /**< Interface protocol ID. */ + uint8_t iInterface; /**< Index of the string descriptor describing the + * interface. + */ + } USB_StdDescriptor_Interface_t; + + /** Type define for a standard Interface Association Descriptor. This structure uses LUFA-specific element names + * to make each element's purpose clearer. * * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at * http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf. It allows compound @@ -377,72 +429,105 @@ * together at the point of enumeration, loading one generic driver for all the interfaces in the single * function. Read the ECN for more information. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * \see \ref USB_StdDescriptor_Interface_Association_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */ - uint8_t TotalInterfaces; /** Total number of associated interfaces. */ - - uint8_t Class; /**< Interface class ID. */ - uint8_t SubClass; /**< Interface subclass ID. */ - uint8_t Protocol; /**< Interface protocol ID. */ - - uint8_t IADStrIndex; /**< Index of the string descriptor describing the - * interface association. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bFirstInterface; - uint8_t bInterfaceCount; - uint8_t bFunctionClass; - uint8_t bFunctionSubClass; - uint8_t bFunctionProtocol; - uint8_t iFunction; - #endif - } USB_Descriptor_Interface_Association_t; + uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */ + uint8_t TotalInterfaces; /** Total number of associated interfaces. */ - /** Type define for a standard endpoint descriptor. + uint8_t Class; /**< Interface class ID. */ + uint8_t SubClass; /**< Interface subclass ID. */ + uint8_t Protocol; /**< Interface protocol ID. */ + + uint8_t IADStrIndex; /**< Index of the string descriptor describing the + * interface association. + */ + } USB_Descriptor_Interface_Association_t; + + /** Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given + * element names to ensure compatibility with the standard. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. - */ + * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at + * http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf. It allows compound + * devices with multiple interfaces related to the same function to have the multiple interfaces bound + * together at the point of enumeration, loading one generic driver for all the interfaces in the single + * function. Read the ECN for more information. + * + * \see \ref USB_Descriptor_Interface_Association_t for the version of this define with non-standard LUFA specific + * element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + uint8_t bFirstInterface; /**< Index of the first associated interface. */ + uint8_t bInterfaceCount; /** Total number of associated interfaces. */ + uint8_t bFunctionClass; /**< Interface class ID. */ + uint8_t bFunctionSubClass; /**< Interface subclass ID. */ + uint8_t bFunctionProtocol; /**< Interface protocol ID. */ + uint8_t iFunction; /**< Index of the string descriptor describing the + * interface association. + */ + } USB_StdDescriptor_Interface_Association_t; + + /** Type define for a standard Endpoint Descriptor. This structure uses LUFA-specific element names + * to make each element's purpose clearer. + * + * \see \ref USB_StdDescriptor_Endpoint_t for the version of this define with standard element names + */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - uint8_t EndpointAddress; /**< Logical address of the endpoint within the device - * for the current configuration, including direction - * mask. - */ - uint8_t Attributes; /**< Endpoint attributes, comprised of a mask of the - * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*) - * masks. - */ - uint16_t EndpointSize; /**< Size of the endpoint bank, in bytes. This indicates the - * maximum packet size that the endpoint can receive at a time. - */ + uint8_t EndpointAddress; /**< Logical address of the endpoint within the device + * for the current configuration, including direction + * mask. + */ + uint8_t Attributes; /**< Endpoint attributes, comprised of a mask of the + * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*) + * masks. + */ + uint16_t EndpointSize; /**< Size of the endpoint bank, in bytes. This indicates the + * maximum packet size that the endpoint can receive at a time. + */ - uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint - * if it is an INTERRUPT or ISOCHRONOUS type. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint16_t wMaxPacketSize; - uint8_t bInterval; - #endif + uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint + * if it is an INTERRUPT or ISOCHRONOUS type. + */ } USB_Descriptor_Endpoint_t; + + /** Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given + * element names to ensure compatibility with the standard. + * + * \see \ref USB_Descriptor_Endpoint_t for the version of this define with non-standard LUFA specific + * element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device + * for the current configuration, including direction + * mask. + */ + uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the + * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*) + * masks. + */ + uint16_t wMaxPacketSize; /**< Size of the endpoint bank, in bytes. This indicates the + * maximum packet size that the endpoint can receive at a time. + */ + uint8_t bInterval; /**< Polling interval in milliseconds for the endpoint + * if it is an INTERRUPT or ISOCHRONOUS type. + */ + } USB_StdDescriptor_Endpoint_t; /** Type define for a standard string descriptor. Unlike other standard descriptors, the length * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN() @@ -451,33 +536,59 @@ * This structure should also be used for string index 0, which contains the supported language IDs for * the device as an array. * - * \note The non-standard structure element names are documented here. If the - * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements - * with names identical to those listed in the USB standard. + * This structure uses LUFA-specific element names to make each element's purpose clearer. + * + * \see \ref USB_StdDescriptor_String_t for the version of this define with standard element names */ typedef struct { - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__) USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ - int16_t UnicodeString[]; /**< String data, as unicode characters (alternatively, - * string language IDs). If normal ASCII characters are - * to be used, they must be added as an array of characters - * rather than a normal C string so that they are widened to - * Unicode size. - * - * Under GCC, strings prefixed with the "L" character (before - * the opening string quotation mark) are considered to be - * Unicode strings, and may be used instead of an explicit - * array of ASCII characters. - */ - #else - uint8_t bLength; - uint8_t bDescriptorType; - int16_t bString[]; - #endif + int16_t UnicodeString[]; /**< String data, as unicode characters (alternatively, + * string language IDs). If normal ASCII characters are + * to be used, they must be added as an array of characters + * rather than a normal C string so that they are widened to + * Unicode size. + * + * Under GCC, strings prefixed with the "L" character (before + * the opening string quotation mark) are considered to be + * Unicode strings, and may be used instead of an explicit + * array of ASCII characters. + */ } USB_Descriptor_String_t; + /** Type define for a standard string descriptor. Unlike other standard descriptors, the length + * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN() + * macro rather than by the size of the descriptor structure, as the length is not fixed. + * + * This structure should also be used for string index 0, which contains the supported language IDs for + * the device as an array. + * + * This structure uses the relevant standard's given element names to ensure compatibility with the standard. + * + * \see \ref USB_Descriptor_String_t for the version of this define with with non-standard LUFA specific + * element names + */ + typedef struct + { + uint8_t bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Type of the descriptor, either a value in + * \ref USB_DescriptorTypes_t or a value + * given by the specific class. + */ + int16_t bString[]; /**< String data, as unicode characters (alternatively, + * string language IDs). If normal ASCII characters are + * to be used, they must be added as an array of characters + * rather than a normal C string so that they are widened to + * Unicode size. + * + * Under GCC, strings prefixed with the "L" character (before + * the opening string quotation mark) are considered to be + * Unicode strings, and may be used instead of an explicit + * array of ASCII characters. + */ + } USB_StdDescriptor_String_t; + /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/LUFA/Drivers/USB/LowLevel/DevChapter9.c index fa35a1b61c..50afb61be2 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.c @@ -232,14 +232,9 @@ static void USB_Device_GetInternalSerialDescriptor(void) int16_t UnicodeString[20]; } SignatureDescriptor; - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) - SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor); - SignatureDescriptor.Header.Type = DTYPE_String; - #else - SignatureDescriptor.Header.bLength = sizeof(SignatureDescriptor); - SignatureDescriptor.Header.bDescriptorType = DTYPE_String; - #endif - + SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor); + SignatureDescriptor.Header.Type = DTYPE_String; + uint8_t SigReadAddress = 0x0E; for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++) diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index 8a51ae5bfc..2685f5f0ba 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -137,11 +137,7 @@ void USB_Host_ProcessNextHostState(void) break; } - #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, Endpoint0Size)]; - #else - USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, bMaxPacketSize0)]; - #endif USB_Host_ResetDevice(); diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 9bbfba113a..6b16e1e7f6 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -40,6 +40,8 @@ * - Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names * are used in a project * - The HID Report Parser now gives information on the total length of each report within a HID interface + * - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_* and + * USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so both may be used * * Fixed: * - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the diff --git a/LUFA/ManPages/CompileTimeTokens.txt b/LUFA/ManPages/CompileTimeTokens.txt index fb051b8c89..8213c678b4 100644 --- a/LUFA/ManPages/CompileTimeTokens.txt +++ b/LUFA/ManPages/CompileTimeTokens.txt @@ -72,12 +72,6 @@ * USE_EEPROM_DESCRIPTORS - ( \ref Group_Descriptors ) \n * Similar to USE_RAM_DESCRIPTORS, but all descriptors are stored in the AVR's EEPROM memory rather than RAM. * - * USE_NONSTANDARD_DESCRIPTOR_NAMES - ( \ref Group_Descriptors ) \n - * The USB 2.0 standard gives some rather obscure names for the elements in the standard descriptor types (device, configuration, - * string, endpoint, etc.). By default the LUFA library uses these names in its predefined descriptor structure types for - * compatibility. If this token is defined, the structure element names are switched to the LUFA-specific but more descriptive - * names documented in the StdDescriptors.h source file. - * * NO_INTERNAL_SERIAL - ( \ref Group_Descriptors ) \n * Some AVR models contain a unique 20-digit serial number which can be used as the device serial number, while in device mode. This * allows the host to uniquely identify the device regardless of if it is moved between USB ports on the same computer, allowing diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt index c098e130df..0070a34acd 100644 --- a/LUFA/ManPages/MigrationInformation.txt +++ b/LUFA/ManPages/MigrationInformation.txt @@ -14,10 +14,10 @@ * * Non-USB Library Components * - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library. - * - The Dataflash_Init() routine no longer initializes the SPI bus - the SPI bus should be initialized manually via a + * - The \ref SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See + * the \ref SPI_Init() function documentation for more details + * - The \ref Dataflash_Init() routine no longer initializes the SPI bus - the SPI bus should be initialized manually via a * call to SPI_Init() before using the Dataflash driver - * - The SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See - * the SPI_Init() function documentation for more details * * Host Mode * - The \ref USB_GetDeviceConfigDescriptor() function's parameters and behaviour has changed; the user is required to @@ -28,6 +28,14 @@ * is interested in into the processed HID report item structure to save RAM. See \ref CALLBACK_HIDParser_FilterHIDReportItem(). * - The HID report parser now always parses FEATURE and always ignores constant-data items - the HID_ENABLE_FEATURE_PROCESSING * and HID_INCLUDE_CONSTANT_DATA_ITEMS compile time tokens now have no effect. + * - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_* + * and USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so that both may be used in + * the one project. For existing projects using the standardized names, change all code to use the USB_StdDescriptor_* variants. + * + * Device Mode + * - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_* + * and USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so that both may be used in + * the one project. For existing projects using the standardized names, change all code to use the USB_StdDescriptor_* variants. * * \section Sec_Migration090810 Migrating from 090605 to 090810 * diff --git a/Projects/AVRISP/makefile b/Projects/AVRISP/makefile index 35e1e42449..6f0cb92859 100644 --- a/Projects/AVRISP/makefile +++ b/Projects/AVRISP/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../ # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=16 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D NO_STREAM_CALLBACKS diff --git a/Projects/Benito/makefile b/Projects/Benito/makefile index 5a1e763782..ac834b0add 100644 --- a/Projects/Benito/makefile +++ b/Projects/Benito/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../../ # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile index f672660b2e..ace13c1ffb 100644 --- a/Projects/Magstripe/makefile +++ b/Projects/Magstripe/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D USB_DEVICE_ONLY +LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS diff --git a/Projects/MissileLauncher/makefile b/Projects/MissileLauncher/makefile index a32030890d..18372a4e3b 100644 --- a/Projects/MissileLauncher/makefile +++ b/Projects/MissileLauncher/makefile @@ -116,8 +116,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options -LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES -LUFA_OPTS += -D NO_STREAM_CALLBACKS +LUFA_OPTS = -D NO_STREAM_CALLBACKS LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"