Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
|
|
|
|
See https://github.com/arduino/Arduino/pull/3840#discussion_r40438845
|
|
|
|
|
|
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
|
|
According to #3786 removed the reference to Leonardo only in while(!Serial) of the examples.
Changed in in "wait for serial port to connect. Needed for native USB port only"
|
|
|
|
See #3812
|
|
Fix #3812
|
|
Fix #66
|
|
|
|
|
|
|
|
|
|
with this PR you can add
\#include Keyboard.h
\#include Mouse.h
\#include HID.h
in the top of the sketch and you will expose a Mouse+Keyboard
From the library pow, simply add
static HID_Descriptor cb = {
.length = sizeof(_hidReportDescriptor),
.descriptor = _hidReportDescriptor,
};
static HIDDescriptorListNode node(&cb);
HID.AppendDescriptor(&node);
in the class' constructor and you are done!
|
|
|
|
was really too common
|
|
|
|
|
|
|
|
|
|
Additional interface method ported to avr for compatibility
Fix issue #2428.
|
|
http://arduino.cc has been changed to http://www.arduino.cc. Fixes #3191
|
|
relying on an undocumented 'types' property. Fixes #2875
|
|
This fixes the Wire examples that uses I2C reserved address (from 0 to 7) substituting them with 8 that is the first one available and that can be used.
I also modified the wire reference
http://www.arduino.cc/en/reference/wire
according to this fact.
|
|
|
|
EEPROM library V2
|
|
|
|
|
|
Removed hard coded lengths, which were incorrect for standard Arduino's
now.
|
|
|
|
previously, e.g. by user sketch
squashes and closes PR #2659
|
|
To avoid having a .cpp just for an extern variable definition, `static`
has been chosen over `extern`.
As the `EEPROMClass` class simply wraps functionality located elsewhere,
it is completely compiled away. Even though each translation unit which
includes the header will get a copy with internal linkage, there is no
associated overhead.
More info
[here](http://stackoverflow.com/questions/29098518/extern-variable-only-in-header-unexpectedly-working-why)
|
|
|
|
|
|
|
|
|
|
|
|
Previously, the TX pin would be set to output first and then written
high (assuming non-inverted logic). When the pin was previously
configured for input without pullup (which is normal reset state), this
results in driving the pin low for a short when initializing. This could
accidenttally be seen as a stop bit by the receiving side.
By first writing HIGH and then setting the mode to OUTPUT, the pin will
have its pullup enabled for a short while, which is harmless.
|
|
The debugPulse function definition already checks for _DEBUG, resulting
in an empty function definiton and the function call being optimized
away.
|