Age | Commit message (Collapse) | Author |
|
|
|
Since the HID library adds some general HID definitions and structs, it is very useful to also include this in a custom library.
If you dupe the information you have problems of redeclaration.
Having those defintions inside the official HID library is essential for a good working additional HID API.
|
|
|
|
Its included by HID.h anyways.
|
|
|
|
|
|
This commit just shows other that this option is available and not implemented.
You may use this to determine the Led Lights state of a keyboard or transmit data via RAWHID from the PC.
Quick usage guide:
int length = ((setup.wValueH << 8) | setup.wLength);
USB_RecvControl((uint8_t* data, USB_EP_SIZE); // Needs to be splitted into USB_EP_SIZE packets, not shown here. See HID Project.
|
|
Alternatively we can only pass the wIndex to getDescriptor but I suggest to just pass the pointer aka reference of the whole setup.
In guess (havent tested this) that this results in more or less the code size but its a) idential with the other functions and b) we late have more flexibility here.
The Code got a quick SerialKeyboard.ino test
|
|
The iterations in the for loop also use unsigned and the setup struct etc as well.
There was no change in HID required since we just init the inherited variables via constructor and the type is never mentioned.
|
|
|
|
|
|
|
|
For details see:
https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
|
|
The field is now built on-the-fly on the stack and sent over USB.
This change increase Flash usage and decrease SRAM usage:
before: 6114 / 241
after: 6152 / 216 (removed HIDDescriptor field)
delta: +38 / -25
SRAM is a much more scarse resource and this change free up to
about 10% of the "base" usage.
|
|
|
|
|
|
|
|
|
|
|
|
The check for available slot in PluggableUSB is done on the endpoint
and not on the number of plugged modules.
The modulesCount field is no longer useful and it has been removed.
|
|
|
|
|
|
There is still the epType[] array to be handled in some way.
|
|
|
|
This change allows the compiler to handle callbacks resolution.
Callbacks now must be implemented on the class that extends
PUSBListNode and this is forced by compiler by means of pure
virtual methods.
Also the calls to HID.interface() and HID.endpoint() can now
be simplified to interface() and endpoint() respectively since
the methods are no more static.
|
|
This commit prepares for the next refactoring
|
|
|
|
The method
int8_t PluggableUSB::addFunction(PUSBListNode *, uint8_t *)
has been changed to
bool PluggableUSB::plug(PUSBListNode *node)
since both EP and Interfaces are now saved directly into node
|
|
This avoid duplicate instatiation of callback and save a
considerable amount of flash.
|
|
|
|
This slightly simplifies PluggableUSB API.
|
|
as asked in #3907
|
|
|
|
|
|
|
|
|
|
|
|
Timer is declared above, so nothing is missing here.
|
|
|
|
|
|
|
|
|
|
See https://github.com/arduino/Arduino/pull/3840#discussion_r40438845
|
|
|
|
|
|
fix pulseInLong considering overflow
|
|
If the includer tries to inlcude IPAddress.h without first including
WString.h the build will fail.
|
|
|
|
This simplifies the object model and produce a small gain in code
size and performance.
|
|
In particular HIDDescriptorListNode.cb has been renamed to
HIDDescriptorListNode.descriptor because it contains decriptor data
and not callbacks.
Moreover the HID_Descriptor.descriptor field has been renamed
to HID_Descriptor.data so the structure has now two fields length
and data.
typedef struct __attribute__((packed)) {
uint16_t length;
const void* data;
} HID_Descriptor;
class HIDDescriptorListNode {
public:
HIDDescriptorListNode *next = NULL;
const HID_Descriptor *descriptor;
HIDDescriptorListNode(const HID_Descriptor *d) : descriptor(d) { }
};
This imply a change in the use of the node from:
node->cb->lenght
node->cd->descriptor
to
node->descriptor->length
node->descriptor->data
|