From 74353374c38237d1c976dabf81703dd885d0d556 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 25 Mar 2010 06:34:38 +0000 Subject: 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. --- LUFA/Drivers/USB/Class/Common/MIDI.h | 2 +- LUFA/Drivers/USB/Class/Common/StillImage.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'LUFA/Drivers/USB/Class/Common') 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: */ -- cgit v1.2.3