aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-08-22 13:54:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-08-22 13:54:51 +0000
commitf6e1eaba7548bce84ae25718d7c37479c4bb0065 (patch)
treea0ea047d3c5dbe8ab71706e00e9fa5b43215bec9
parente72f424f6450cf67d3ef57d347a4f8d86ec5a119 (diff)
downloadlufa-f6e1eaba7548bce84ae25718d7c37479c4bb0065.tar.gz
lufa-f6e1eaba7548bce84ae25718d7c37479c4bb0065.tar.bz2
lufa-f6e1eaba7548bce84ae25718d7c37479c4bb0065.zip
Optimise Endpoint_ConfigureEndpoint_Prv() function to produce smaller code when CONTROL_ONLY_DEVICE compile time token is defined.
-rw-r--r--LUFA/Drivers/USB/LowLevel/Endpoint.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.c b/LUFA/Drivers/USB/LowLevel/Endpoint.c
index 742e61860..4b2d1c059 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.c
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.c
@@ -43,6 +43,16 @@ bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
const uint8_t UECFG0XData,
const uint8_t UECFG1XData)
{
+#if defined(CONTROL_ONLY_DEVICE)
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+ Endpoint_EnableEndpoint();
+
+ UECFG1X = 0;
+ UECFG0X = UECFG0XData;
+ UECFG1X = UECFG1XData;
+
+ return Endpoint_IsConfigured();
+#else
uint8_t UECFG0XTemp[ENDPOINT_TOTAL_ENDPOINTS];
uint8_t UECFG1XTemp[ENDPOINT_TOTAL_ENDPOINTS];
@@ -82,6 +92,7 @@ bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
Endpoint_SelectEndpoint(Number);
return true;
+#endif
}
void Endpoint_ClearEndpoints(void)