Add static keyword to all project globals whose scope should be restricted to the same module as they are declared in.

Tighten up the HID class bootloader code slightly, document that it currently exceeds 2KB of bootloader space for all models other than the Series 2 USB AVRs.
This commit is contained in:
Dean Camera 2011-02-10 17:55:49 +00:00
parent 57b382558d
commit 782614dbb5
62 changed files with 192 additions and 211 deletions

View file

@ -51,6 +51,7 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -51,6 +51,7 @@ USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -86,6 +86,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -37,10 +37,10 @@
#include "GenericHID.h"
/** Buffer to hold the previously generated HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevHIDReportBuffer[GENERIC_REPORT_SIZE];
static uint8_t PrevHIDReportBuffer[GENERIC_REPORT_SIZE];
/** Structure to contain reports from the host, so that they can be echoed back upon request */
struct
static struct
{
uint8_t ReportID;
uint16_t ReportSize;
@ -66,6 +66,7 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -37,7 +37,7 @@
#include "Joystick.h"
/** Buffer to hold the previously generated HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevJoystickHIDReportBuffer[sizeof(USB_JoystickReport_Data_t)];
static uint8_t PrevJoystickHIDReportBuffer[sizeof(USB_JoystickReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -58,6 +58,7 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -37,7 +37,7 @@
#include "Keyboard.h"
/** Buffer to hold the previously generated Keyboard HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
static uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -58,6 +58,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -37,10 +37,10 @@
#include "KeyboardMouse.h"
/** Buffer to hold the previously generated Keyboard HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
static uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
/** Buffer to hold the previously generated Mouse HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
static uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -81,6 +81,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -37,7 +37,7 @@
#include "KeyboardMouseMultiReport.h"
/** Buffer to hold the previously generated HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevHIDReportBuffer[MAX(sizeof(USB_KeyboardReport_Data_t), sizeof(USB_MouseReport_Data_t))];
static uint8_t PrevHIDReportBuffer[MAX(sizeof(USB_KeyboardReport_Data_t), sizeof(USB_MouseReport_Data_t))];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -58,6 +58,7 @@ USB_ClassInfo_HID_Device_t Device_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -56,6 +56,7 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -41,7 +41,7 @@
/** Structure to hold the SCSI response data to a SCSI INQUIRY command. This gives information about the device's
* features and capabilities.
*/
SCSI_Inquiry_Response_t InquiryData =
static const SCSI_Inquiry_Response_t InquiryData =
{
.DeviceType = DEVICE_TYPE_BLOCK,
.PeripheralQualifier = 0,
@ -73,7 +73,7 @@ SCSI_Inquiry_Response_t InquiryData =
/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
* command is issued. This gives information on exactly why the last command failed to complete.
*/
SCSI_Request_Sense_Response_t SenseData =
static SCSI_Request_Sense_Response_t SenseData =
{
.ResponseCode = 0x70,
.AdditionalLength = 0x0A,

View file

@ -58,6 +58,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -41,7 +41,7 @@
/** Structure to hold the SCSI response data to a SCSI INQUIRY command. This gives information about the device's
* features and capabilities.
*/
SCSI_Inquiry_Response_t InquiryData =
static const SCSI_Inquiry_Response_t InquiryData =
{
.DeviceType = DEVICE_TYPE_BLOCK,
.PeripheralQualifier = 0,
@ -73,7 +73,7 @@ SCSI_Inquiry_Response_t InquiryData =
/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
* command is issued. This gives information on exactly why the last command failed to complete.
*/
SCSI_Request_Sense_Response_t SenseData =
static SCSI_Request_Sense_Response_t SenseData =
{
.ResponseCode = 0x70,
.AdditionalLength = 0x0A,

View file

@ -60,7 +60,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
};
/** Buffer to hold the previously generated Keyboard HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
static uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class

View file

@ -37,7 +37,7 @@
#include "Mouse.h"
/** Buffer to hold the previously generated Mouse HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
static uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -58,6 +58,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -63,6 +63,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -65,6 +65,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
*/
static FILE USBSerialStream;
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/

View file

@ -61,7 +61,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
};
/** Buffer to hold the previously generated Mouse HID report, for comparison purposes inside the HID class driver. */
uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
static uint8_t PrevMouseHIDReportBuffer[sizeof(USB_MouseReport_Data_t)];
/** LUFA HID Class driver interface configuration and state information. This structure is
* passed to all HID Class driver functions, so that multiple instances of the same class
@ -82,6 +82,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
},
};
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/