Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added new NO_SOF_EVENTS compile time option, enabled in the bootloade…

…rs to reduce the compiled binary size.

git-svn-id: http://lufa-lib.googlecode.com/svn@1516 d5102386-fcda-11dd-9fdb-3debd5008f28
  • Loading branch information...
commit 7f91f6944157f3d65e24e78c59a1542c01d601b3 1 parent 404bf4f
Dean authored
1  trunk/Bootloaders/CDC/makefile
@@ -122,6 +122,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL
122 122 LUFA_OPTS += -D NO_DEVICE_SELF_POWER
123 123 LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
124 124 LUFA_OPTS += -D NO_STREAM_CALLBACKS
  125 +LUFA_OPTS += -D NO_SOF_EVENTS
125 126
126 127
127 128 # Create the LUFA source path variables by including the LUFA root makefile
1  trunk/Bootloaders/DFU/makefile
@@ -123,6 +123,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL
123 123 LUFA_OPTS += -D NO_DEVICE_SELF_POWER
124 124 LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
125 125 LUFA_OPTS += -D NO_STREAM_CALLBACKS
  126 +LUFA_OPTS += -D NO_SOF_EVENTS
126 127
127 128
128 129 # Create the LUFA source path variables by including the LUFA root makefile
2  trunk/LUFA.pnproj
1 addition, 1 deletion not shown
4 trunk/LUFA/Drivers/Board/CULV3/Buttons.h
@@ -29,7 +29,7 @@
29 29 */
30 30
31 31 /** \file
32   - * \brief Board specific LED driver header for the Busware CUL V3.
  32 + * \brief Board specific LED driver header for the Busware CULV3.
33 33 *
34 34 * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
35 35 *
@@ -38,7 +38,7 @@
38 38 */
39 39
40 40 /** \ingroup Group_LEDs
41   - * @defgroup Group_LEDs_CULV3 CUL V3
  41 + * @defgroup Group_LEDs_CULV3 CULV3
42 42 *
43 43 * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
44 44 *
2  trunk/LUFA/Drivers/Board/CULV3/LEDs.h
@@ -38,7 +38,7 @@
38 38 */
39 39
40 40 /** \ingroup Group_LEDs
41   - * @defgroup Group_LEDs_CULV3 CUL V3
  41 + * @defgroup Group_LEDs_CULV3 CULV3
42 42 *
43 43 * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
44 44 *
42 trunk/LUFA/Drivers/USB/LowLevel/Device.h
@@ -148,24 +148,30 @@
148 148 return UDFNUM;
149 149 }
150 150
151   - /** Enables the device mode Start Of Frame events. When enabled, this causes the
152   - * \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
153   - * at the start of each USB frame when enumerated in device mode.
154   - */
155   - static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
156   - static inline void USB_Device_EnableSOFEvents(void)
157   - {
158   - USB_INT_Enable(USB_INT_SOFI);
159   - }
160   -
161   - /** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
162   - * \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
163   - */
164   - static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
165   - static inline void USB_Device_DisableSOFEvents(void)
166   - {
167   - USB_INT_Disable(USB_INT_SOFI);
168   - }
  151 + #if !defined(NO_SOF_EVENTS)
  152 + /** Enables the device mode Start Of Frame events. When enabled, this causes the
  153 + * \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
  154 + * at the start of each USB frame when enumerated in device mode.
  155 + *
  156 + * \note Not available when the NO_SOF_EVENTS compile time token is defined.
  157 + */
  158 + static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
  159 + static inline void USB_Device_EnableSOFEvents(void)
  160 + {
  161 + USB_INT_Enable(USB_INT_SOFI);
  162 + }
  163 +
  164 + /** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
  165 + * \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
  166 + *
  167 + * \note Not available when the NO_SOF_EVENTS compile time token is defined.
  168 + */
  169 + static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
  170 + static inline void USB_Device_DisableSOFEvents(void)
  171 + {
  172 + USB_INT_Disable(USB_INT_SOFI);
  173 + }
  174 + #endif
169 175
170 176 /* Function Prototypes: */
171 177 /** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
44 trunk/LUFA/Drivers/USB/LowLevel/Host.h
@@ -253,25 +253,31 @@
253 253 return UHFNUM;
254 254 }
255 255
256   - /** Enables the host mode Start Of Frame events. When enabled, this causes the
257   - * \ref EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
258   - * at the start of each USB frame when a device is enumerated while in host mode.
259   - */
260   - static inline void USB_Host_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
261   - static inline void USB_Host_EnableSOFEvents(void)
262   - {
263   - USB_INT_Enable(USB_INT_HSOFI);
264   - }
265   -
266   - /** Disables the host mode Start Of Frame events. When disabled, this stops the firing of the
267   - * \ref EVENT_USB_Host_StartOfFrame() event when enumerated in host mode.
268   - */
269   - static inline void USB_Host_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
270   - static inline void USB_Host_DisableSOFEvents(void)
271   - {
272   - USB_INT_Disable(USB_INT_HSOFI);
273   - }
274   -
  256 + #if !defined(NO_SOF_EVENTS)
  257 + /** Enables the host mode Start Of Frame events. When enabled, this causes the
  258 + * \ref EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
  259 + * at the start of each USB frame when a device is enumerated while in host mode.
  260 + *
  261 + * \note Not available when the NO_SOF_EVENTS compile time token is defined.
  262 + */
  263 + static inline void USB_Host_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
  264 + static inline void USB_Host_EnableSOFEvents(void)
  265 + {
  266 + USB_INT_Enable(USB_INT_HSOFI);
  267 + }
  268 +
  269 + /** Disables the host mode Start Of Frame events. When disabled, this stops the firing of the
  270 + * \ref EVENT_USB_Host_StartOfFrame() event when enumerated in host mode.
  271 + *
  272 + * \note Not available when the NO_SOF_EVENTS compile time token is defined.
  273 + */
  274 + static inline void USB_Host_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
  275 + static inline void USB_Host_DisableSOFEvents(void)
  276 + {
  277 + USB_INT_Disable(USB_INT_HSOFI);
  278 + }
  279 + #endif
  280 +
275 281 /** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host.
276 282 * USB bus resets leave the default control pipe configured (if already configured).
277 283 *
4 trunk/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
@@ -162,12 +162,14 @@ ISR(USB_GEN_vect, ISR_BLOCK)
162 162 EVENT_USB_Device_Reset();
163 163 }
164 164
  165 + #if !defined(NO_SOF_EVENTS)
165 166 if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI))
166 167 {
167 168 USB_INT_Clear(USB_INT_SOFI);
168 169
169 170 EVENT_USB_Device_StartOfFrame();
170 171 }
  172 + #endif
171 173 #endif
172 174
173 175 #if defined(USB_CAN_BE_HOST)
@@ -217,6 +219,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
217 219 USB_ResetInterface();
218 220 }
219 221
  222 + #if !defined(NO_SOF_EVENTS)
220 223 if (USB_INT_HasOccurred(USB_INT_HSOFI) && USB_INT_IsEnabled(USB_INT_HSOFI))
221 224 {
222 225 USB_INT_Clear(USB_INT_HSOFI);
@@ -224,6 +227,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
224 227 EVENT_USB_Host_StartOfFrame();
225 228 }
226 229 #endif
  230 + #endif
227 231
228 232 #if defined(USB_CAN_BE_BOTH)
229 233 if (USB_INT_HasOccurred(USB_INT_IDTI) && USB_INT_IsEnabled(USB_INT_IDTI))
5 trunk/LUFA/ManPages/CompileTimeTokens.txt
@@ -115,6 +115,11 @@
115 115 * can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro.
116 116 * When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.
117 117 *
  118 + * <b>NO_SOF_EVENTS</b> - ( \ref Group_Events ) \n
  119 + * By default, there exists a LUFA application event for the start of each USB frame while the USB bus is not suspended in either host or device mode.
  120 + * This event can be selectively enabled or disabled by calling the appropriate device or host mode function. When this compile time token is defined,
  121 + * the ability to receive USB Start of Frame events via the \ref EVENT_USB_Device_StartOfFrame() or \ref EVENT_USB_Host_StartOfFrame() events is removed,
  122 + * reducing the compiled program's binary size.
118 123 *
119 124 * \section Sec_SummaryUSBDeviceTokens USB Device Mode Driver Related Tokens
120 125 * This section describes compile tokens which affect USB driver stack of the LUFA library when used in Device mode.

0 comments on commit 7f91f69

Please sign in to comment.
Something went wrong with that request. Please try again.