aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-03-25 06:34:38 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-03-25 06:34:38 +0000
commit74353374c38237d1c976dabf81703dd885d0d556 (patch)
treec96599e868d2fbe7215c86fe5a2dfe2d217846f7 /LUFA/Drivers/USB/Class/Common
parentb8db5fc1e7a49c0b91a67570e11edf90f985cd00 (diff)
downloadlufa-74353374c38237d1c976dabf81703dd885d0d556.tar.gz
lufa-74353374c38237d1c976dabf81703dd885d0d556.tar.bz2
lufa-74353374c38237d1c976dabf81703dd885d0d556.zip
All Class Driver Host mode demos now correctly set the board LEDs to READY once the enumeration process has completed.
Fixed Still Image Host class driver not resetting the transaction ID when a new session is opened, fixed driver not sending a valid session ID to the device.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Common')
-rw-r--r--LUFA/Drivers/USB/Class/Common/MIDI.h2
-rw-r--r--LUFA/Drivers/USB/Class/Common/StillImage.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h
index 8eed10198..755006a70 100644
--- a/LUFA/Drivers/USB/Class/Common/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Common/MIDI.h
@@ -87,7 +87,7 @@
*
* \param[in] channel MIDI channel number to address
*/
- #define MIDI_CHANNEL(channel) (channel - 1)
+ #define MIDI_CHANNEL(channel) ((channel) - 1)
/* Type Defines: */
/** Type define for an Audio class specific MIDI streaming interface descriptor. This indicates to the host
diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h
index 7b3df201a..e65b2dbfd 100644
--- a/LUFA/Drivers/USB/Class/Common/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Common/StillImage.h
@@ -63,23 +63,23 @@
*
* \return Number of bytes of the given unicode string
*/
- #define UNICODE_STRING_LENGTH(chars) (chars << 1)
+ #define UNICODE_STRING_LENGTH(chars) ((chars) << 1)
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
* a command container.
*
* \param[in] params Number of parameters which are to be sent in the Param field of the container
*/
- #define PIMA_COMMAND_SIZE(params) ((sizeof(SI_PIMA_Container_t) - sizeof(((SI_PIMA_Container_t*)NULL)->Params)) + \
- (params * sizeof(uint32_t)))
+ #define PIMA_COMMAND_SIZE(params) ((sizeof(SI_PIMA_Container_t) - 12) + \
+ ((params) * sizeof(uint32_t)))
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
* a data container.
*
* \param[in] datalen Length in bytes of the data in the container
*/
- #define PIMA_DATA_SIZE(datalen) ((sizeof(SI_PIMA_Container_t) - sizeof(((SI_PIMA_Container_t*)NULL)->Params)) + \
- datalen)
+ #define PIMA_DATA_SIZE(datalen) ((sizeof(SI_PIMA_Container_t) - 12) + \
+ (datalen))
/* Enums: */
/** Enum for the possible PIMA contains types. */
@@ -122,7 +122,7 @@
uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */
uint16_t Code; /**< Command, event or response code of the container */
uint32_t TransactionID; /**< Unique container ID to link blocks together */
- uint32_t Params[5]; /**< Block parameters to be issued along with the block code (command blocks only) */
+ uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only) */
} SI_PIMA_Container_t;
/* Disable C linkage for C++ Compilers: */