Add more missing function attributes to the TWI peripheral driver.
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 12 Jul 2011 05:18:10 +0000 (05:18 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 12 Jul 2011 05:18:10 +0000 (05:18 +0000)
Fix incorrect standard request name in the host standard request driver.

LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
LUFA/Drivers/USB/Core/HostStandardReq.c

index 8ff38a1..df63b6a 100644 (file)
 
                        /** Receives a byte from the currently addressed device on the TWI bus.
                         *
-                        *  \param[in] Byte      Location where the read byte is to be stored
-                        *  \param[in] LastByte  Indicates if the byte should be ACKed if false, NAKed if true
+                        *  \param[in] Byte      Location where the read byte is to be stored.
+                        *  \param[in] LastByte  Indicates if the byte should be ACKed if false, NAKed if true.
                         *
-                        *  \return Boolean \c true if the byte reception successfully completed, \c false otherwise
+                        *  \return Boolean \c true if the byte reception successfully completed, \c false otherwise.
                         */
-                       static inline uint8_t TWI_ReceiveByte(uint8_t* const Byte,
-                                                             const bool LastByte)
+                       static inline bool TWI_ReceiveByte(uint8_t* const Byte,
+                                                          const bool LastByte)
                        {
                                uint8_t TWCRMask = ((1 << TWINT) | (1 << TWEN));
 
                /* Function Prototypes: */
                        /** Begins a master mode TWI bus communication with the given slave device address.
                         *
-                        *  \param[in] SlaveAddress  Address of the slave TWI device to communicate with
-                        *  \param[in] TimeoutMS     Timeout period within which the slave must respond, in milliseconds
+                        *  \param[in] SlaveAddress  Address of the slave TWI device to communicate with.
+                        *  \param[in] TimeoutMS     Timeout period within which the slave must respond, in milliseconds.
                         *
-                        *  \return A value from the \ref TWI_ErrorCodes_t enum
+                        *  \return A value from the \ref TWI_ErrorCodes_t enum.
                         */
                        uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,
                                                      const uint8_t TimeoutMS);
                        /** High level function to perform a complete packet transfer over the TWI bus to the specified
                         *  device.
                         *
-                        *  \param[in] SlaveAddress        Base address of the TWI slave device to communicate with
-                        *  \param[in] TimeoutMS           Timeout for bus capture and slave START ACK, in milliseconds
-                        *  \param[in] InternalAddress     Pointer to a location where the internal slave read start address is stored
-                        *  \param[in] InternalAddressLen  Size of the internal device address, in bytes
-                        *  \param[in] Buffer              Pointer to a buffer where the read packet data is to be stored
-                        *  \param[in] Length              Size of the packet to read, in bytes
+                        *  \param[in] SlaveAddress        Base address of the TWI slave device to communicate with.
+                        *  \param[in] TimeoutMS           Timeout for bus capture and slave START ACK, in milliseconds.
+                        *  \param[in] InternalAddress     Pointer to a location where the internal slave read start address is stored.
+                        *  \param[in] InternalAddressLen  Size of the internal device address, in bytes.
+                        *  \param[in] Buffer              Pointer to a buffer where the read packet data is to be stored.
+                        *  \param[in] Length              Size of the packet to read, in bytes.
+                        *
+                        *  \return A value from the \ref TWI_ErrorCodes_t enum.
                         */
                        uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
                                               const uint8_t TimeoutMS,
                                               const uint8_t* InternalAddress,
                                               const uint8_t InternalAddressLen,
                                               uint8_t* Buffer,
-                                              uint8_t Length);
+                                              uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
 
                        /** High level function to perform a complete packet transfer over the TWI bus from the specified
                         *  device.
                         *  \param[in] InternalAddressLen  Size of the internal device address, in bytes
                         *  \param[in] Buffer              Pointer to a buffer where the packet data to send is stored
                         *  \param[in] Length              Size of the packet to send, in bytes
+                        *
+                        *  \return A value from the \ref TWI_ErrorCodes_t enum.
                         */
                        uint8_t TWI_WritePacket(const uint8_t SlaveAddress,
                                                const uint8_t TimeoutMS,
                                                const uint8_t* InternalAddress,
                                                uint8_t InternalAddressLen,
                                                const uint8_t* Buffer,
-                                               uint8_t Length);
+                                               uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
index 12ccd91..3da2220 100644 (file)
@@ -243,7 +243,7 @@ uint8_t USB_Host_GetDeviceStatus(uint8_t* const FeatureStatus)
        USB_ControlRequest = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
-                       .bRequest      = REQ_GetFeature,
+                       .bRequest      = REQ_GetStatus,
                        .wValue        = 0,
                        .wIndex        = 0,
                        .wLength       = 0,