Commit 292a631b authored by Dean Camera's avatar Dean Camera
Browse files

Added new NO_SOF_EVENTS compile time option, enabled in the bootloaders to...

Added new NO_SOF_EVENTS compile time option, enabled in the bootloaders to reduce the compiled binary size.
parent ccc82ce7
...@@ -122,6 +122,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL ...@@ -122,6 +122,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_SOF_EVENTS
# Create the LUFA source path variables by including the LUFA root makefile # Create the LUFA source path variables by including the LUFA root makefile
......
...@@ -123,6 +123,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL ...@@ -123,6 +123,7 @@ LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_SOF_EVENTS
# Create the LUFA source path variables by including the LUFA root makefile # Create the LUFA source path variables by including the LUFA root makefile
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
/** \file /** \file
* \brief Board specific LED driver header for the Busware CUL V3. * \brief Board specific LED driver header for the Busware CULV3.
* *
* Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
* *
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
*/ */
/** \ingroup Group_LEDs /** \ingroup Group_LEDs
* @defgroup Group_LEDs_CULV3 CUL V3 * @defgroup Group_LEDs_CULV3 CULV3
* *
* Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
* *
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
*/ */
/** \ingroup Group_LEDs /** \ingroup Group_LEDs
* @defgroup Group_LEDs_CULV3 CUL V3 * @defgroup Group_LEDs_CULV3 CULV3
* *
* Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
* *
......
...@@ -148,9 +148,12 @@ ...@@ -148,9 +148,12 @@
return UDFNUM; return UDFNUM;
} }
#if !defined(NO_SOF_EVENTS)
/** Enables the device mode Start Of Frame events. When enabled, this causes the /** Enables the device mode Start Of Frame events. When enabled, this causes the
* \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus, * \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
* at the start of each USB frame when enumerated in device mode. * at the start of each USB frame when enumerated in device mode.
*
* \note Not available when the NO_SOF_EVENTS compile time token is defined.
*/ */
static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE; static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_EnableSOFEvents(void) static inline void USB_Device_EnableSOFEvents(void)
...@@ -160,12 +163,15 @@ ...@@ -160,12 +163,15 @@
/** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the /** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
* \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode. * \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
*
* \note Not available when the NO_SOF_EVENTS compile time token is defined.
*/ */
static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE; static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_DisableSOFEvents(void) static inline void USB_Device_DisableSOFEvents(void)
{ {
USB_INT_Disable(USB_INT_SOFI); USB_INT_Disable(USB_INT_SOFI);
} }
#endif
/* Function Prototypes: */ /* Function Prototypes: */
/** Function to retrieve a given descriptor's size and memory location from the given descriptor type value, /** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
......
...@@ -253,9 +253,12 @@ ...@@ -253,9 +253,12 @@
return UHFNUM; return UHFNUM;
} }
#if !defined(NO_SOF_EVENTS)
/** Enables the host mode Start Of Frame events. When enabled, this causes the /** Enables the host mode Start Of Frame events. When enabled, this causes the
* \ref EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus, * \ref EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
* at the start of each USB frame when a device is enumerated while in host mode. * at the start of each USB frame when a device is enumerated while in host mode.
*
* \note Not available when the NO_SOF_EVENTS compile time token is defined.
*/ */
static inline void USB_Host_EnableSOFEvents(void) ATTR_ALWAYS_INLINE; static inline void USB_Host_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Host_EnableSOFEvents(void) static inline void USB_Host_EnableSOFEvents(void)
...@@ -265,12 +268,15 @@ ...@@ -265,12 +268,15 @@
/** Disables the host mode Start Of Frame events. When disabled, this stops the firing of the /** Disables the host mode Start Of Frame events. When disabled, this stops the firing of the
* \ref EVENT_USB_Host_StartOfFrame() event when enumerated in host mode. * \ref EVENT_USB_Host_StartOfFrame() event when enumerated in host mode.
*
* \note Not available when the NO_SOF_EVENTS compile time token is defined.
*/ */
static inline void USB_Host_DisableSOFEvents(void) ATTR_ALWAYS_INLINE; static inline void USB_Host_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Host_DisableSOFEvents(void) static inline void USB_Host_DisableSOFEvents(void)
{ {
USB_INT_Disable(USB_INT_HSOFI); USB_INT_Disable(USB_INT_HSOFI);
} }
#endif
/** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host. /** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host.
* USB bus resets leave the default control pipe configured (if already configured). * USB bus resets leave the default control pipe configured (if already configured).
......
...@@ -162,6 +162,7 @@ ISR(USB_GEN_vect, ISR_BLOCK) ...@@ -162,6 +162,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Device_Reset(); EVENT_USB_Device_Reset();
} }
#if !defined(NO_SOF_EVENTS)
if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI))
{ {
USB_INT_Clear(USB_INT_SOFI); USB_INT_Clear(USB_INT_SOFI);
...@@ -169,6 +170,7 @@ ISR(USB_GEN_vect, ISR_BLOCK) ...@@ -169,6 +170,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Device_StartOfFrame(); EVENT_USB_Device_StartOfFrame();
} }
#endif #endif
#endif
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
if (USB_INT_HasOccurred(USB_INT_DDISCI) && USB_INT_IsEnabled(USB_INT_DDISCI)) if (USB_INT_HasOccurred(USB_INT_DDISCI) && USB_INT_IsEnabled(USB_INT_DDISCI))
...@@ -217,6 +219,7 @@ ISR(USB_GEN_vect, ISR_BLOCK) ...@@ -217,6 +219,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_ResetInterface(); USB_ResetInterface();
} }
#if !defined(NO_SOF_EVENTS)
if (USB_INT_HasOccurred(USB_INT_HSOFI) && USB_INT_IsEnabled(USB_INT_HSOFI)) if (USB_INT_HasOccurred(USB_INT_HSOFI) && USB_INT_IsEnabled(USB_INT_HSOFI))
{ {
USB_INT_Clear(USB_INT_HSOFI); USB_INT_Clear(USB_INT_HSOFI);
...@@ -224,6 +227,7 @@ ISR(USB_GEN_vect, ISR_BLOCK) ...@@ -224,6 +227,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Host_StartOfFrame(); EVENT_USB_Host_StartOfFrame();
} }
#endif #endif
#endif
#if defined(USB_CAN_BE_BOTH) #if defined(USB_CAN_BE_BOTH)
if (USB_INT_HasOccurred(USB_INT_IDTI) && USB_INT_IsEnabled(USB_INT_IDTI)) if (USB_INT_HasOccurred(USB_INT_IDTI) && USB_INT_IsEnabled(USB_INT_IDTI))
......
...@@ -115,6 +115,11 @@ ...@@ -115,6 +115,11 @@
* 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. * 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.
* When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events. * When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.
* *
* <b>NO_SOF_EVENTS</b> - ( \ref Group_Events ) \n
* 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.
* This event can be selectively enabled or disabled by calling the appropriate device or host mode function. When this compile time token is defined,
* 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,
* reducing the compiled program's binary size.
* *
* \section Sec_SummaryUSBDeviceTokens USB Device Mode Driver Related Tokens * \section Sec_SummaryUSBDeviceTokens USB Device Mode Driver Related Tokens
* This section describes compile tokens which affect USB driver stack of the LUFA library when used in Device mode. * This section describes compile tokens which affect USB driver stack of the LUFA library when used in Device mode.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment