Added new PIMA_DATA_SIZE() define to the Still Image Host demo.
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 2 Apr 2009 10:13:12 +0000 (10:13 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 2 Apr 2009 10:13:12 +0000 (10:13 +0000)
Demos/Host/StillImageHost/StillImageCommands.h
LUFA/ChangeLog.txt

index 2ac6afd..38bbadf 100644 (file)
                /** Timeout period between the issuing of a command to a device, and the reception of the first packet */\r
                #define COMMAND_DATA_TIMEOUT_MS        5000\r
                \r
-               /** Used in the DataLength field of a PIMA container, to give the total container size in bytes.\r
+               /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for\r
+                *  a command container.\r
                 *\r
                 *  \param params  Number of parameters which are to be sent in the Param field of the container\r
                 */\r
                #define PIMA_COMMAND_SIZE(params)      ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + \\r
                                                        (params * sizeof(PIMA_SendBlock.Params[0])))\r
 \r
+               /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for\r
+                *  a data container.\r
+                *\r
+                *  \param datalen  Length in bytes of the data in the container\r
+                */\r
+               #define PIMA_DATA_SIZE(datalen)        ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + datalen)\r
+\r
        /* Type Defines: */\r
                /** Type define for a PIMA container, use to send commands and receive responses to and from an\r
                 *  attached Still Image device.\r
@@ -71,7 +79,7 @@
                        uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */\r
                        uint16_t Code; /**< Command, event or response code of the container */\r
                        uint32_t TransactionID; /**< Unique container ID to link blocks together */\r
-                       uint32_t Params[4]; /**< Block parameters to be issued along with the block code */\r
+                       uint32_t Params[4]; /**< Block parameters to be issued along with the block code (command blocks only) */\r
                } PIMA_Container_t;\r
        \r
        /* Enums: */\r
index 036e031..3622f66 100644 (file)
@@ -14,6 +14,7 @@
   *  - Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOINT and INTERRUPT_CONTROL_ENDPOINT compile\r
   *    time options\r
   *  - All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected\r
+  *  - Added new PIMA_DATA_SIZE() define to the Still Image Host demo\r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
   *\r