Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
64e93612
Commit
64e93612
authored
Feb 04, 2012
by
Dean Camera
Browse files
Minor corrections to the XMEGA USB controller implementation.
parent
df33278d
Changes
4
Show whitespace changes
Inline
Side-by-side
LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
View file @
64e93612
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
uint8_t
USB_Device_ControlEndpointSize
=
ENDPOINT_CONTROLEP_DEFAULT_SIZE
;
uint8_t
USB_Device_ControlEndpointSize
=
ENDPOINT_CONTROLEP_DEFAULT_SIZE
;
#endif
#endif
Endpoint_FIFOPair_t
USB_Endpoint_FIFOs
[
ENDPOINT_
DETAILS_MAXEP
];
Endpoint_FIFOPair_t
USB_Endpoint_FIFOs
[
ENDPOINT_
TOTAL_ENDPOINTS
];
volatile
uint8_t
USB_Endpoint_SelectedEndpoint
;
volatile
uint8_t
USB_Endpoint_SelectedEndpoint
;
volatile
USB_EP_t
*
USB_Endpoint_SelectedHandle
;
volatile
USB_EP_t
*
USB_Endpoint_SelectedHandle
;
...
@@ -66,8 +66,11 @@ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
...
@@ -66,8 +66,11 @@ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
void
Endpoint_ClearEndpoints
(
void
)
void
Endpoint_ClearEndpoints
(
void
)
{
{
for
(
uint8_t
EPNum
=
0
;
EPNum
<
(
ENDPOINT_TOTAL_ENDPOINTS
*
2
);
EPNum
++
)
for
(
uint8_t
EPNum
=
0
;
EPNum
<
ENDPOINT_TOTAL_ENDPOINTS
;
EPNum
++
)
((
USB_EP_t
*
)
&
USB_EndpointTable
)[
EPNum
].
CTRL
=
0
;
{
USB_EndpointTable
.
Endpoints
[
EPNum
].
IN
.
CTRL
=
0
;
USB_EndpointTable
.
Endpoints
[
EPNum
].
OUT
.
CTRL
=
0
;
}
}
}
void
Endpoint_ClearStatusStage
(
void
)
void
Endpoint_ClearStatusStage
(
void
)
...
...
LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
View file @
64e93612
...
@@ -391,7 +391,10 @@
...
@@ -391,7 +391,10 @@
static
inline
bool
Endpoint_IsReadWriteAllowed
(
void
)
ATTR_WARN_UNUSED_RESULT
ATTR_ALWAYS_INLINE
;
static
inline
bool
Endpoint_IsReadWriteAllowed
(
void
)
ATTR_WARN_UNUSED_RESULT
ATTR_ALWAYS_INLINE
;
static
inline
bool
Endpoint_IsReadWriteAllowed
(
void
)
static
inline
bool
Endpoint_IsReadWriteAllowed
(
void
)
{
{
if
(
USB_Endpoint_SelectedEndpoint
&
ENDPOINT_DIR_IN
)
return
(
USB_Endpoint_SelectedFIFO
->
Position
<
USB_Endpoint_SelectedFIFO
->
Length
);
return
(
USB_Endpoint_SelectedFIFO
->
Position
<
USB_Endpoint_SelectedFIFO
->
Length
);
else
return
(
USB_Endpoint_SelectedFIFO
->
Position
>
0
);
}
}
/** Determines if the currently selected endpoint is configured.
/** Determines if the currently selected endpoint is configured.
...
...
LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c
View file @
64e93612
...
@@ -35,6 +35,8 @@ uint8_t TEMPLATE_FUNC_NAME (void* const Buffer,
...
@@ -35,6 +35,8 @@ uint8_t TEMPLATE_FUNC_NAME (void* const Buffer,
{
{
uint8_t
*
DataStream
=
((
uint8_t
*
)
Buffer
+
TEMPLATE_BUFFER_OFFSET
(
Length
));
uint8_t
*
DataStream
=
((
uint8_t
*
)
Buffer
+
TEMPLATE_BUFFER_OFFSET
(
Length
));
Endpoint_SelectEndpoint
(
USB_Endpoint_SelectedEndpoint
&
~
ENDPOINT_DIR_IN
);
if
(
!
(
Length
))
if
(
!
(
Length
))
Endpoint_ClearOUT
();
Endpoint_ClearOUT
();
...
...
LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c
View file @
64e93612
...
@@ -36,6 +36,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
...
@@ -36,6 +36,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
uint8_t
*
DataStream
=
((
uint8_t
*
)
Buffer
+
TEMPLATE_BUFFER_OFFSET
(
Length
));
uint8_t
*
DataStream
=
((
uint8_t
*
)
Buffer
+
TEMPLATE_BUFFER_OFFSET
(
Length
));
bool
LastPacketFull
=
false
;
bool
LastPacketFull
=
false
;
Endpoint_SelectEndpoint
(
USB_Endpoint_SelectedEndpoint
|
ENDPOINT_DIR_IN
);
if
(
Length
>
USB_ControlRequest
.
wLength
)
if
(
Length
>
USB_ControlRequest
.
wLength
)
Length
=
USB_ControlRequest
.
wLength
;
Length
=
USB_ControlRequest
.
wLength
;
else
if
(
!
(
Length
))
else
if
(
!
(
Length
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment