The HID parser will now be a part of the next MyUSB release, in the actual library. I’ve created a new folder called Class in the Drivers/USB/ directory for class-specific USB drivers and convenience API.
I’ve since made a bunch of changes to the parser, which now works with collections. Having to support collections means making linked list structures, so that for each report item, a pointer to a collection path node is present. To determine all the parent usages, you simply walk the list back to when PARENT == NULL and check the usages.
The last change to the parser I believe is to make a usages stack for the report items. Once that’s done, it should be complete enough for general use. I’ve tried it with my mice as well; my wireless Logitec works just as well as my $5 cheapy, despite the radically different report structures.
The only downside to the parser is the RAM usage. With the report and collection items being on the global structure as well as a state table stack and usages stack in the parser routine, it will require quite a bit of RAM when used (about 300 bytes with modest sizes of each stack).
If anyone needs a pre-release containing the parser before the official release, send me an email.
Recent Comments