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.).
This commit is contained in:
Dean Camera 2009-12-09 00:50:55 +00:00
parent 2281750b5f
commit 7ace314cc1
61 changed files with 133 additions and 122 deletions

View file

@ -57,7 +57,7 @@
/* Macros: */
/** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */
#define PROGRAMMER_ID "AVRISP_MK2"
#define PROGRAMMER_ID "AVRISP_MK2"
/** Timeout in milliseconds of target busy-wait loops waiting for a command to complete */
#define TARGET_BUSY_TIMEOUT_MS 240

View file

@ -68,7 +68,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
/* External Variables: */
extern FILE DiskStream;

View file

@ -287,7 +287,7 @@ void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength)
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = 0x09,
.bRequest = REQ_SetReport,
.wValue = 0x02,
.wIndex = 0x01,
.wLength = ReportLength,

View file

@ -55,13 +55,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