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:
		
							parent
							
								
									2281750b5f
								
							
						
					
					
						commit
						7ace314cc1
					
				
					 61 changed files with 133 additions and 122 deletions
				
			
		| 
						 | 
				
			
			@ -42,10 +42,10 @@
 | 
			
		|||
		#include "MassStorage.h"
 | 
			
		||||
		#include "Descriptors.h"
 | 
			
		||||
 | 
			
		||||
		#include <LUFA/Common/Common.h>                 // Function Attribute, Atomic, Debug and ISR Macros
 | 
			
		||||
		#include <LUFA/Drivers/USB/USB.h>               // USB Functionality
 | 
			
		||||
		#include <LUFA/Drivers/USB/Class/MassStorage.h> // Mass Storage Class Driver
 | 
			
		||||
		#include <LUFA/Drivers/Board/Dataflash.h>       // Dataflash chip driver
 | 
			
		||||
		#include <LUFA/Common/Common.h>
 | 
			
		||||
		#include <LUFA/Drivers/USB/USB.h>
 | 
			
		||||
		#include <LUFA/Drivers/USB/Class/MassStorage.h>
 | 
			
		||||
		#include <LUFA/Drivers/Board/Dataflash.h>
 | 
			
		||||
 | 
			
		||||
	/* Preprocessor Checks: */
 | 
			
		||||
		#if (DATAFLASH_PAGE_SIZE % 16)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,9 +56,9 @@
 | 
			
		|||
		 *  \param[in] acode  New SCSI additional sense key to set the additional sense code to
 | 
			
		||||
		 *  \param[in] aqual  New SCSI additional sense key qualifier to set the additional sense qualifier code to
 | 
			
		||||
		 */
 | 
			
		||||
		#define SCSI_SET_SENSE(key, acode, aqual)  MACROS{ SenseData.SenseKey = key;              \
 | 
			
		||||
		                                                   SenseData.AdditionalSenseCode = acode; \
 | 
			
		||||
		                                                   SenseData.AdditionalSenseQualifier = aqual; }MACROE
 | 
			
		||||
		#define SCSI_SET_SENSE(key, acode, aqual)  MACROS{ SenseData.SenseKey = (key);                   \
 | 
			
		||||
		                                                   SenseData.AdditionalSenseCode = (acode);      \
 | 
			
		||||
		                                                   SenseData.AdditionalSenseQualifier = (aqual); }MACROE
 | 
			
		||||
 | 
			
		||||
		/** Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */
 | 
			
		||||
		#define DATA_READ           true
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,7 +65,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
 | 
			
		||||
		
 | 
			
		||||
		/** Total number of logical drives within the device - must be non-zero. */
 | 
			
		||||
		#define TOTAL_LUNS                1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,9 +42,9 @@
 | 
			
		|||
		#include "MassStorageKeyboard.h"
 | 
			
		||||
		#include "Descriptors.h"
 | 
			
		||||
 | 
			
		||||
		#include <LUFA/Common/Common.h>              // Function Attribute, Atomic, Debug and ISR Macros
 | 
			
		||||
		#include <LUFA/Drivers/USB/USB.h>            // USB Functionality
 | 
			
		||||
		#include <LUFA/Drivers/Board/Dataflash.h>    // Dataflash chip driver
 | 
			
		||||
		#include <LUFA/Common/Common.h>
 | 
			
		||||
		#include <LUFA/Drivers/USB/USB.h>
 | 
			
		||||
		#include <LUFA/Drivers/Board/Dataflash.h>
 | 
			
		||||
 | 
			
		||||
	/* Preprocessor Checks: */
 | 
			
		||||
		#if (DATAFLASH_PAGE_SIZE % 16)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,7 +72,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
 | 
			
		||||
		
 | 
			
		||||
		/** Total number of logical drives within the device - must be non-zero. */
 | 
			
		||||
		#define TOTAL_LUNS               1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,7 +71,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
 | 
			
		||||
		
 | 
			
		||||
	/* Function Prototypes: */
 | 
			
		||||
		void SetupHardware(void);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue