projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor documentation page updates.
[pub/USBasp.git]
/
Demos
/
Host
/
KeyboardHost
/
ConfigDescriptor.c
diff --git
a/Demos/Host/KeyboardHost/ConfigDescriptor.c
b/Demos/Host/KeyboardHost/ConfigDescriptor.c
index
1735401
..
e586ea5
100644
(file)
--- a/
Demos/Host/KeyboardHost/ConfigDescriptor.c
+++ b/
Demos/Host/KeyboardHost/ConfigDescriptor.c
@@
-69,7
+69,8
@@
uint8_t ProcessConfigurationDescriptor(void)
return InvalidConfigDataReturned;
\r
\r
/* Get the keyboard interface from the configuration descriptor */
\r
return InvalidConfigDataReturned;
\r
\r
/* Get the keyboard interface from the configuration descriptor */
\r
- if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface))
\r
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
\r
+ DComp_NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)
\r
{
\r
/* Descriptor not found, error out */
\r
return NoHIDInterfaceFound;
\r
{
\r
/* Descriptor not found, error out */
\r
return NoHIDInterfaceFound;
\r
@@
-77,7
+78,7
@@
uint8_t ProcessConfigurationDescriptor(void)
\r
/* Get the keyboard interface's data endpoint descriptor */
\r
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
\r
\r
/* Get the keyboard interface's data endpoint descriptor */
\r
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
\r
-
NextInterfaceKeyboardDataEndpoint)
)
\r
+
DComp_NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found
)
\r
{
\r
/* Descriptor not found, error out */
\r
return NoEndpointFound;
\r
{
\r
/* Descriptor not found, error out */
\r
return NoEndpointFound;
\r
@@
-91,13
+92,6
@@
uint8_t ProcessConfigurationDescriptor(void)
EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
\r
\r
Pipe_SetInfiniteINRequests();
\r
EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
\r
\r
Pipe_SetInfiniteINRequests();
\r
-
\r
- #if defined(INTERRUPT_DATA_PIPE)
\r
- Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
\r
-
\r
- /* Enable the pipe IN interrupt for the data pipe */
\r
- USB_INT_Enable(PIPE_INT_IN);
\r
- #endif
\r
\r
/* Valid data found, return success */
\r
return SuccessfulConfigRead;
\r
\r
/* Valid data found, return success */
\r
return SuccessfulConfigRead;
\r
@@
-111,7
+105,7
@@
uint8_t ProcessConfigurationDescriptor(void)
*
\r
* \return A value from the DSEARCH_Return_ErrorCodes_t enum
\r
*/
\r
*
\r
* \return A value from the DSEARCH_Return_ErrorCodes_t enum
\r
*/
\r
-
DESCRIPTOR_COMPARATOR(NextKeyboardInterface
)
\r
+
uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor
)
\r
{
\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
\r
{
\r
{
\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
\r
{
\r
@@
-119,11
+113,11
@@
DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) &&
\r
(DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))
\r
{
\r
if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) &&
\r
(DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))
\r
{
\r
- return D
escriptor_Search
_Found;
\r
+ return D
ESCRIPTOR_SEARCH
_Found;
\r
}
\r
}
\r
\r
}
\r
}
\r
\r
- return D
escriptor_Search
_NotFound;
\r
+ return D
ESCRIPTOR_SEARCH
_NotFound;
\r
}
\r
\r
/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
\r
}
\r
\r
/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
\r
@@
-135,17
+129,17
@@
DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
*
\r
* \return A value from the DSEARCH_Return_ErrorCodes_t enum
\r
*/
\r
*
\r
* \return A value from the DSEARCH_Return_ErrorCodes_t enum
\r
*/
\r
-
DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint
)
\r
+
uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor
)
\r
{
\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
\r
{
\r
if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
\r
{
\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
\r
{
\r
if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
\r
- return D
escriptor_Search
_Found;
\r
+ return D
ESCRIPTOR_SEARCH
_Found;
\r
}
\r
else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
\r
{
\r
}
\r
else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
\r
{
\r
- return D
escriptor_Search
_Fail;
\r
+ return D
ESCRIPTOR_SEARCH
_Fail;
\r
}
\r
\r
}
\r
\r
- return D
escriptor_Search
_NotFound;
\r
+ return D
ESCRIPTOR_SEARCH
_NotFound;
\r
}
\r
}
\r