Commit Graph

26 Commits

Author SHA1 Message Date
Martino Facchin b9bb55584c [USB] use plugged modules name to create iSerial field 2015-10-21 15:23:56 +02:00
Cristian Maglie 80e228483d [PUSB] Renamed PUSBListNode to PluggableUSBModule 2015-10-12 12:14:07 +02:00
NicoHood ec2cf46acf [PUSB] Removed unnecessary endpoint and interface function 2015-10-07 20:39:50 +02:00
NicoHood fdb1fd384b [PUSB] Made getDescriptor() and setup() more flexible
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
2015-10-07 19:02:40 +02:00
NicoHood b75da2a1e5 [PUSB] Changed Interface + Endpoint to unsigned variables
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.
2015-10-07 18:45:10 +02:00
Cristian Maglie f0f10cb290 [PUSB] renamed some parameters 2015-10-07 13:21:21 +02:00
NicoHood 9196eaed87 Removed not needed public statement for root node 2015-10-03 07:56:48 +02:00
Martino Facchin a6c4a6395e [PUSB] Fix static initialization order fiasco
For details see:
https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
2015-10-02 11:59:24 +02:00
Cristian Maglie 4d6ab7431b [PUSB] Fixed check for available endpoints
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.
2015-10-02 11:59:23 +02:00
Cristian Maglie c5fd3853e6 [PUSB] No more static fields in PluggableUSB class 2015-10-02 11:59:23 +02:00
Cristian Maglie a044f89f01 [PUSB] The latest fields are now set via constructor 2015-10-02 11:59:23 +02:00
Cristian Maglie 93e7f0b91b [PUSB] callbacks are now pure virtual methods
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.
2015-10-02 11:59:23 +02:00
Cristian Maglie 4245515325 [PUSB] replaced u8 with uint8_t 2015-10-02 11:59:22 +02:00
Cristian Maglie 6d4cbd0ee5 [PUSB] Selected interface and endpoint are now part of PUSBListNode
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
2015-10-02 11:59:22 +02:00
Cristian Maglie 9b4c249090 [PUSB] Global functions PUSB_* are now methods of PluggableUSB class 2015-10-02 11:59:22 +02:00
Cristian Maglie c25a5eefc7 [PUSB] PUSBCallback struct has been merged into PUSBListNode
This slightly simplifies PluggableUSB API.
2015-10-02 11:59:22 +02:00
Nico 219c9ac945 Removed not used PUSB_Begin() 2015-09-29 17:02:07 +02:00
Cristian Maglie 9baff248c4 [HID] Removed unused PUSBReturn structure 2015-09-28 17:05:35 +02:00
Martino Facchin a83da2c299 fix pluggableUSB linked list 2015-07-16 13:13:52 +02:00
Martino Facchin 512e369e80 rename Setup typedef struct to USBSetup
was really too common
2015-07-16 13:13:52 +02:00
Martino Facchin 880b0468fe fix HID descriptors bigger than 127 bytes 2015-07-16 13:13:51 +02:00
Martino Facchin fa573da910 rework PUSBCallbacks initialization 2015-07-16 13:13:39 +02:00
Martino Facchin 1e08066640 add numInterfaces field to PUSBCallbacks 2015-07-16 13:12:15 +02:00
Martino Facchin d13b52085e implement PUSB modules as linked list 2015-07-16 13:12:14 +02:00
Martino Facchin d1f15236ee remove useless variables 2015-07-16 13:12:14 +02:00
Martino Facchin f7631cdee9 add PluggableUSB module 2015-07-16 13:12:14 +02:00