Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman).

Capitolised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums.

Minor documentation improvements.
This commit is contained in:
Dean Camera 2009-04-19 11:43:21 +00:00
parent 32e735b2b2
commit 663f449c10
33 changed files with 142 additions and 119 deletions

View file

@ -125,9 +125,9 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != Descriptor_Search_NotFound)
if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)
{
if (ErrorCode == Descriptor_Search_Fail)
if (ErrorCode == DESCRIPTOR_SEARCH_Fail)
{
*CurrConfigLoc = PrevDescLoc;
*BytesRem = PrevBytesRem;
@ -137,5 +137,5 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
}
}
return Descriptor_Search_Comp_EndOfDescriptor;
return DESCRIPTOR_SEARCH_COMP_EndOfDescriptor;
}

View file

@ -122,7 +122,7 @@
*/
#define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor)
/* Psuedo-Functions: */
/* Pseudo-Function Macros: */
#if defined(__DOXYGEN__)
/** Searches for the next descriptor in the given configuration descriptor using a premade comparator
* function. The routine updates the position and remaining configuration descriptor bytes values
@ -146,9 +146,9 @@
* DESCRIPTOR_COMPARATOR(EndpointSearcher)
* {
* if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
* return Descriptor_Search_Found;
* return DESCRIPTOR_SEARCH_Found;
* else
* return Descriptor_Search_NotFound;
* return DESCRIPTOR_SEARCH_NotFound;
* }
*
* //...
@ -169,18 +169,18 @@
/** Enum for return values of a descriptor comparator made with DESCRIPTOR_COMPARATOR. */
enum DSearch_Return_ErrorCodes_t
{
Descriptor_Search_Found = 0, /**< Current descriptor matches comparator criteria. */
Descriptor_Search_Fail = 1, /**< No further descriptor could possibly match criteria, fail the search. */
Descriptor_Search_NotFound = 2, /**< Current descriptor does not match comparator criteria. */
DESCRIPTOR_SEARCH_Found = 0, /**< Current descriptor matches comparator criteria. */
DESCRIPTOR_SEARCH_Fail = 1, /**< No further descriptor could possibly match criteria, fail the search. */
DESCRIPTOR_SEARCH_NotFound = 2, /**< Current descriptor does not match comparator criteria. */
};
/** Enum for return values of USB_GetNextDescriptorComp(). */
enum DSearch_Comp_Return_ErrorCodes_t
{
Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to descriptor which matches
DESCRIPTOR_SEARCH_COMP_Found = 0, /**< Configuration descriptor now points to descriptor which matches
* search criteria of the given comparator function. */
Descriptor_Search_Comp_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */
Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */
DESCRIPTOR_SEARCH_COMP_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */
DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */
};
/* Function Prototypes: */

View file

@ -30,7 +30,7 @@
#include "HIDParser.h"
uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
{
HID_StateTable_t StateTable[HID_STATETABLE_STACK_DEPTH];
HID_StateTable_t* CurrStateTable = &StateTable[0];
@ -275,7 +275,7 @@ uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_Rep
return HID_PARSE_Successful;
}
bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
{
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;
@ -303,7 +303,7 @@ bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const Report
return true;
}
void SetReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)
void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)
{
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;