aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-18 10:05:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-18 10:05:21 +0000
commit2ee9fc707784e115d744dbc229bdc893f4bb6bc1 (patch)
tree1f4de5f6d8e2a9bfe89d3263f19f9b9ebf855812 /LUFA/Drivers/USB/HighLevel/USBInterrupt.c
parent72c2922e38a2dfd14eb2d8e3692171704b5508f4 (diff)
downloadlufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.tar.gz
lufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.tar.bz2
lufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.zip
Rewritten event system to remove all macros, to make user code clearer.
Fixed incorrect ENDPOINT_EPNUM_MASK mask preventing endpoints above EP3 from being selected (thanks to Jonathan Oakley). Removed STREAM_CALLBACK() macro - callbacks now use regular function definitions to clarify user code. Removed DESCRIPTOR_COMPARATOR() macro - comparators should now use regular function definitions to clarify user code.
Diffstat (limited to 'LUFA/Drivers/USB/HighLevel/USBInterrupt.c')
-rw-r--r--LUFA/Drivers/USB/HighLevel/USBInterrupt.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
index 14d277c9a..86dfa855a 100644
--- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
+++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
@@ -72,24 +72,24 @@ ISR(USB_GEN_vect, ISR_BLOCK)
{
USB_INT_Clear(USB_INT_VBUS);
- RAISE_EVENT(USB_VBUSChange);
+ EVENT_USB_VBUSChange();
if (USB_VBUS_GetStatus())
{
- RAISE_EVENT(USB_VBUSConnect);
+ EVENT_USB_VBUSConnect();
if (USB_IsConnected)
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_Disconnect();
USB_ResetInterface();
USB_IsConnected = true;
- RAISE_EVENT(USB_Connect);
+ EVENT_USB_Connect();
}
else
{
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_Disconnect();
USB_Detach();
USB_CLK_Freeze();
@@ -98,7 +98,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_IsConnected = false;
- RAISE_EVENT(USB_VBUSDisconnect);
+ EVENT_USB_VBUSDisconnect();
USB_INT_Clear(USB_INT_VBUS);
}
@@ -119,13 +119,13 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_IsSuspended = true;
- RAISE_EVENT(USB_Suspend);
+ EVENT_USB_Suspend();
#if defined(USB_LIMITED_CONTROLLER) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
if (USB_IsConnected)
{
USB_IsConnected = false;
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_Disconnect();
}
#endif
}
@@ -149,13 +149,13 @@ ISR(USB_GEN_vect, ISR_BLOCK)
if (!(USB_IsConnected))
{
USB_IsConnected = true;
- RAISE_EVENT(USB_Connect);
+ EVENT_USB_Connect();
}
#endif
USB_IsSuspended = false;
- RAISE_EVENT(USB_WakeUp);
+ EVENT_USB_WakeUp();
}
if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
@@ -178,7 +178,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Enable(USB_INT_ENDPOINT_SETUP);
#endif
- RAISE_EVENT(USB_Reset);
+ EVENT_USB_Reset();
}
#endif
@@ -189,8 +189,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Clear(USB_INT_DCONNI);
USB_INT_Disable(USB_INT_DDISCI);
- RAISE_EVENT(USB_DeviceUnattached);
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_DeviceUnattached();
+ EVENT_USB_Disconnect();
USB_ResetInterface();
}
@@ -202,8 +202,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_Host_VBUS_Manual_Off();
USB_Host_VBUS_Auto_Off();
- RAISE_EVENT(USB_HostError, HOST_ERROR_VBusVoltageDip);
- RAISE_EVENT(USB_DeviceUnattached);
+ EVENT_USB_HostError(HOST_ERROR_VBusVoltageDip);
+ EVENT_USB_DeviceUnattached();
USB_HostState = HOST_STATE_Unattached;
}
@@ -213,7 +213,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Clear(USB_INT_SRPI);
USB_INT_Disable(USB_INT_SRPI);
- RAISE_EVENT(USB_DeviceAttached);
+ EVENT_USB_DeviceAttached();
USB_INT_Enable(USB_INT_DDISCI);
@@ -224,11 +224,11 @@ ISR(USB_GEN_vect, ISR_BLOCK)
{
USB_INT_Clear(USB_INT_BCERRI);
- RAISE_EVENT(USB_DeviceEnumerationFailed, HOST_ENUMERROR_NoDeviceDetected, 0);
- RAISE_EVENT(USB_DeviceUnattached);
+ EVENT_USB_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);
+ EVENT_USB_DeviceUnattached();
if (USB_IsConnected)
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_Disconnect();
USB_ResetInterface();
}
@@ -242,12 +242,12 @@ ISR(USB_GEN_vect, ISR_BLOCK)
if (USB_IsConnected)
{
if (USB_CurrentMode == USB_MODE_HOST)
- RAISE_EVENT(USB_DeviceUnattached);
+ EVENT_USB_DeviceUnattached();
else
- RAISE_EVENT(USB_Disconnect);
+ EVENT_USB_Disconnect();
}
- RAISE_EVENT(USB_UIDChange);
+ EVENT_USB_UIDChange();
USB_ResetInterface();
}