diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-02-10 17:55:49 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-02-10 17:55:49 +0000 |
commit | 782614dbb55addcae8c9d4d9e1ce3dec81287282 (patch) | |
tree | bb4ba0005e5b7687d6866ea70ee899d772d04b1b /Demos/Device/LowLevel | |
parent | 57b382558d0f2a5146bea735943f09c6d1b83286 (diff) | |
download | lufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.tar.gz lufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.tar.bz2 lufa-782614dbb55addcae8c9d4d9e1ce3dec81287282.zip |
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.
Diffstat (limited to 'Demos/Device/LowLevel')
-rw-r--r-- | Demos/Device/LowLevel/AudioInput/AudioInput.c | 3 | ||||
-rw-r--r-- | Demos/Device/LowLevel/AudioOutput/AudioOutput.c | 3 | ||||
-rw-r--r-- | Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c | 16 | ||||
-rw-r--r-- | Demos/Device/LowLevel/Keyboard/Keyboard.c | 6 | ||||
-rw-r--r-- | Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c | 4 | ||||
-rw-r--r-- | Demos/Device/LowLevel/MassStorage/Lib/SCSI.c | 4 | ||||
-rw-r--r-- | Demos/Device/LowLevel/Mouse/Mouse.c | 6 | ||||
-rw-r--r-- | Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c | 9 |
8 files changed, 27 insertions, 24 deletions
diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index ab5af7364..ac819c1b0 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -37,7 +37,8 @@ #include "AudioInput.h" /** Flag to indicate if the streaming audio alternative interface has been selected by the host. */ -bool StreamingAudioInterfaceSelected = false; +static bool StreamingAudioInterfaceSelected = false; + /** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index 826073230..64a297315 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -37,7 +37,8 @@ #include "AudioOutput.h" /** Flag to indicate if the streaming audio alternative interface has been selected by the host. */ -bool StreamingAudioInterfaceSelected = false; +static bool StreamingAudioInterfaceSelected = false; + /** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c index 14aa0be71..b9391296b 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c @@ -44,10 +44,10 @@ * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical * serial link characteristics and instead sends and receives data in endpoint streams. */ -CDC_LineEncoding_t LineEncoding1 = { .BaudRateBPS = 0, - .CharFormat = CDC_LINEENCODING_OneStopBit, - .ParityType = CDC_PARITY_None, - .DataBits = 8 }; +static CDC_LineEncoding_t LineEncoding1 = { .BaudRateBPS = 0, + .CharFormat = CDC_LINEENCODING_OneStopBit, + .ParityType = CDC_PARITY_None, + .DataBits = 8 }; /** Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use * the physical USART and thus does not use these settings, they must still be retained and returned to the host @@ -57,10 +57,10 @@ CDC_LineEncoding_t LineEncoding1 = { .BaudRateBPS = 0, * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical * serial link characteristics and instead sends and receives data in endpoint streams. */ -CDC_LineEncoding_t LineEncoding2 = { .BaudRateBPS = 0, - .CharFormat = CDC_LINEENCODING_OneStopBit, - .ParityType = CDC_PARITY_None, - .DataBits = 8 }; +static CDC_LineEncoding_t LineEncoding2 = { .BaudRateBPS = 0, + .CharFormat = CDC_LINEENCODING_OneStopBit, + .ParityType = CDC_PARITY_None, + .DataBits = 8 }; /** Main program entry point. This routine configures the hardware required by the application, then diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index 94f0f7deb..5ff724778 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -40,18 +40,18 @@ /** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot * protocol reporting mode. */ -bool UsingReportProtocol = true; +static bool UsingReportProtocol = true; /** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports * for either the entire idle duration, or until the report status changes (e.g. the user presses a key). */ -uint16_t IdleCount = 500; +static uint16_t IdleCount = 500; /** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle * milliseconds. This is separate to the IdleCount timer and is incremented and compared as the host may request * the current idle period via a Get Idle HID class request, thus its value must be preserved. */ -uint16_t IdleMSRemaining = 0; +static uint16_t IdleMSRemaining = 0; /** Main program entry point. This routine configures the hardware required by the application, then diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index fbb742ca4..ca061eef8 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -38,10 +38,10 @@ #include "KeyboardMouse.h" /** Global structure to hold the current keyboard interface HID report, for transmission to the host */ -USB_KeyboardReport_Data_t KeyboardReportData; +static USB_KeyboardReport_Data_t KeyboardReportData; /** Global structure to hold the current mouse interface HID report, for transmission to the host */ -USB_MouseReport_Data_t MouseReportData; +static USB_MouseReport_Data_t MouseReportData; /** Main program entry point. This routine configures the hardware required by the application, then diff --git a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c index 0400cc2c6..770d0f7bc 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c +++ b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c @@ -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, diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 808cf50b0..ef6c911cc 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -39,18 +39,18 @@ /** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot * protocol reporting mode. */ -bool UsingReportProtocol = true; +static bool UsingReportProtocol = true; /** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse). */ -uint16_t IdleCount = 0; +static uint16_t IdleCount = 0; /** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle * milliseconds. This is separate to the IdleCount timer and is incremented and compared as the host may request * the current idle period via a Get Idle HID class request, thus its value must be preserved. */ -uint16_t IdleMSRemaining = 0; +static uint16_t IdleMSRemaining = 0; /** Main program entry point. This routine configures the hardware required by the application, then diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c index e841ab530..f4d3d4dd2 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c @@ -44,10 +44,11 @@ * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical * serial link characteristics and instead sends and receives data in endpoint streams. */ -CDC_LineEncoding_t LineEncoding = { .BaudRateBPS = 0, - .CharFormat = CDC_LINEENCODING_OneStopBit, - .ParityType = CDC_PARITY_None, - .DataBits = 8 }; +static CDC_LineEncoding_t LineEncoding = { .BaudRateBPS = 0, + .CharFormat = CDC_LINEENCODING_OneStopBit, + .ParityType = CDC_PARITY_None, + .DataBits = 8 }; + /** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. |