From 7ace314cc12f24c1c3108311bdfb3a2ed484ab37 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 9 Dec 2009 00:50:55 +0000 Subject: Increase timeout of Mass Storage and Still Image host commands to 10 seconds (up from 5) to account for slow-processing devices. Added brace guards to macros with parameters to prevent unintended changed evaluation of the macro expression. Minor code cleanups (remove redundant comments, fix spacing, etc.). --- Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h | 2 +- Demos/Host/ClassDriver/PrinterHost/PrinterHost.h | 2 +- Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h | 2 +- Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h | 2 +- Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.h | 2 +- Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h | 4 ++-- Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h | 6 +++--- Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h | 2 +- .../Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h | 2 +- Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h | 2 +- .../Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h | 2 +- Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h | 2 +- Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h | 2 +- Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/MouseHost/MouseHost.h | 4 ++-- Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h | 2 +- Demos/Host/LowLevel/PrinterHost/PrinterHost.h | 2 +- Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h | 2 +- Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h | 2 +- Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h | 8 ++++---- Demos/Host/LowLevel/StillImageHost/StillImageHost.h | 2 +- 26 files changed, 33 insertions(+), 33 deletions(-) (limited to 'Demos/Host') diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index 4c3539fd0..45646ce86 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -65,7 +65,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h index 24e42ebca..762192763 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h @@ -64,7 +64,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h index ea87648c0..48dc939c6 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h @@ -64,7 +64,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h index e94368714..6b59289df 100644 --- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h +++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h @@ -32,7 +32,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "BluetoothHost.h" diff --git a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.h b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.h index 46edbdb27..9de8bc1b5 100644 --- a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.h +++ b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.h @@ -32,7 +32,7 @@ #define _DEVICEDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "BluetoothHost.h" diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h index 48616106d..7cc1576ae 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h @@ -37,13 +37,13 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "GenericHIDHost.h" /* Macros: */ /** Interface Class value for the Human Interface Device class */ - #define HID_CLASS 0x03 + #define HID_CLASS 0x03 /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */ #define MAX_CONFIG_DESCRIPTOR_SIZE 512 diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h index 1c6210ad2..bae5369ad 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h @@ -54,13 +54,13 @@ /* Macros: */ /** Pipe number for the HID data IN pipe */ - #define HID_DATA_IN_PIPE 1 + #define HID_DATA_IN_PIPE 1 /** Pipe number for the HID data OUT pipe */ - #define HID_DATA_OUT_PIPE 2 + #define HID_DATA_OUT_PIPE 2 /** HID Class specific request to send a HID report to the device. */ - #define REQ_SetReport 0x09 + #define REQ_SetReport 0x09 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h index 62684306f..7fcd5113e 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index 73c593850..32e2626f7 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -54,7 +54,7 @@ /* Macros: */ /** Pipe number for the joystick report data pipe */ - #define JOYSTICK_DATAPIPE 1 + #define JOYSTICK_DATAPIPE 1 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h index 6dd9366ab..07d3b2e93 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "KeyboardHost.h" diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h index 9c6575cb1..2a6d56ddb 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h index 8453bb661..461c2a059 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -49,7 +49,7 @@ /* Macros: */ /** Pipe number for the keyboard report data pipe */ - #define KEYBOARD_DATAPIPE 1 + #define KEYBOARD_DATAPIPE 1 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h index 8a49e2bd0..1ca24d495 100644 --- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "MIDIHost.h" diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h index 2f311a5bb..e51faa481 100644 --- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "MassStorageHost.h" diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h index c7bb7c7d9..9ce419b4f 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h @@ -64,7 +64,7 @@ #define COMMAND_DIRECTION_DATA_IN (1 << 7) /** Timeout period between the issuing of a CBW to a device, and the reception of the first packet */ - #define COMMAND_DATA_TIMEOUT_MS 2000 + #define COMMAND_DATA_TIMEOUT_MS 10000 /** Pipe number of the Mass Storage data IN pipe */ #define MASS_STORE_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index e9f02784c..663b7205d 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -70,7 +70,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void MassStorage_Task(void); diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h index 6a194b1c8..1acf20592 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "MouseHost.h" diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.h b/Demos/Host/LowLevel/MouseHost/MouseHost.h index 6a31c658b..207ac0c34 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.h +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.h @@ -54,10 +54,10 @@ /* Macros: */ /** Pipe number for the mouse data IN pipe */ - #define MOUSE_DATAPIPE 1 + #define MOUSE_DATAPIPE 1 /** HID Class Specific request to set the report protocol mode */ - #define REQ_SetProtocol 0x0B + #define REQ_SetProtocol 0x0B /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h index 7b33c7428..fe0419798 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h index 92782cf75..9183cca1a 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h @@ -54,7 +54,7 @@ /* Macros: */ /** Pipe number for the mouse report data pipe */ - #define MOUSE_DATAPIPE 1 + #define MOUSE_DATAPIPE 1 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index db7a9fe7e..b5008c1e9 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -67,7 +67,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void EVENT_USB_Host_DeviceAttached(void); diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h index 4279c1a13..d2d1596f7 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "RNDISEthernetHost.h" diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h index 47e5c24d1..480c1138f 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h @@ -67,7 +67,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Type Defines: */ /** Type define for a RNDIS notification message, for transmission to the RNDIS host via the notification diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h index 24dd0664d..946edb16b 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h @@ -37,7 +37,7 @@ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ - #include // USB Functionality + #include #include "StillImageHost.h" diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h index 6ac70fc50..b38f5c176 100644 --- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h +++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h @@ -37,7 +37,7 @@ #define _STILL_IMAGE_COMMANDS_H_ /* Includes: */ - #include // USB Functionality + #include #include "PIMACodes.h" @@ -55,10 +55,10 @@ * * \param[in] chars Total number of Unicode characters in the string */ - #define UNICODE_STRING_LENGTH(chars) (chars << 1) + #define UNICODE_STRING_LENGTH(chars) ((chars) << 1) /** Timeout period between the issuing of a command to a device, and the reception of the first packet */ - #define COMMAND_DATA_TIMEOUT_MS 5000 + #define COMMAND_DATA_TIMEOUT_MS 10000 /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for * a command container. @@ -66,7 +66,7 @@ * \param[in] params Number of parameters which are to be sent in the Param field of the container */ #define PIMA_COMMAND_SIZE(params) ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + \ - (params * sizeof(PIMA_SendBlock.Params[0]))) + ((params) * sizeof(PIMA_SendBlock.Params[0]))) /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for * a data container. diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h index 89956e0f5..23077c44c 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h @@ -66,7 +66,7 @@ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ - #define LEDMASK_USB_BUSY (LEDS_LED2) + #define LEDMASK_USB_BUSY LEDS_LED2 /* Function Prototypes: */ void StillImage_Task(void); -- cgit v1.2.3