Commit Graph

556 Commits

Author SHA1 Message Date
tico-tico 487bbfde38 huh? i guess it's just 'modulo'. let's save even more 2016-03-03 10:53:25 -05:00
Paulo Costa be2eb2635f Boilerplate compression on ISR declaration
The current code is very verbose and a painful to maintain (Change ISR implementation in 20 different places? No Thanks!).

(This was originally part of #4519, but we all agreeded it deserved it's own PR)
2016-02-03 22:43:57 -02:00
vbextreme ccb832c224 fix delay/yield on avr, if function called by yield takes more a millisecond the delay fails 2015-12-27 14:50:56 +01:00
Cristian Maglie c96d9bc6ec Merge NicoHood's fix for USB_SendControl with len>64
Fix #4325
2015-12-23 15:35:08 +01:00
NicoHood 2369610047 Added >64 byte USB_RecvControl() support 2015-12-23 15:31:55 +01:00
NicoHood 87b4f726a7 Added Long USB RecvControl call for >64 bytes 2015-12-19 01:53:24 +01:00
Sandeep Mistry e2c80d0389 Cleanup some Stream compiler warnings from #3337 2015-11-23 16:45:29 -05:00
Chris--A 507f2ee84a Make protected Stream::parseInt/Float overloads public.
Stream::parseInt & Stream::parseFloat previously had protected
overloads which allowed skipping a custom character. This commit
brings this feature to the public interface.

To keep the public API simpler, the single paramter overload remains
protected. However its functionality is available in the public
interface using the two parameter overload.
2015-11-23 15:46:24 -05:00
Chris--A db295bda6a This adds control of Stream::parseInt/float lookahead.
Its default is SKIP_ALL which reflects previous versions.
However SKIP_NONE, and SKIP_WHITESPACE can refine this behaviour.

A parameter used in the protected overloads of parseInt/Float has been
changed from `skipChar` to `ignore`.
2015-11-23 15:46:24 -05:00
Chris--A 475bcd1d4f This is a bug fix which prevents parseFloat from proceeding past
multiple decimals '.' in the stream. Only one can be accepted for
valid decimal numbers.
2015-11-23 15:46:24 -05:00
Chris--A 29e1dbb8be This commit improves the parsing capability by allowing decimals only
prefixed by an '.' character. Previously the preceeding zero must be
present: '0.'
2015-11-23 15:46:23 -05:00
Martino Facchin ced062988b [USB] use plugged modules name to create iSerial field 2015-10-21 15:23:56 +02:00
Cristian Maglie 2e755384f5 [PUSB] Renamed PUSBListNode to PluggableUSBModule 2015-10-12 12:14:07 +02:00
Nico 290167f705 [PUSB] Minor Style change 2015-10-09 22:10:45 +02:00
Cristian Maglie f2d7b52e1b [HID] Improved checks in getDescriptor() method 2015-10-08 16:38:57 +02:00
NicoHood abd6b795c4 [PUSB] Removed unnecessary endpoint and interface function 2015-10-07 20:39:50 +02:00
NicoHood dfe89ddd01 [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 4a1921932d [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 663c55706b [PUSB] renamed some parameters 2015-10-07 13:21:21 +02:00
NicoHood eb084e235d Small return value error check correction 2015-10-07 12:39:18 +02:00
NicoHood 9cd24d7a0d Removed not needed public statement for root node 2015-10-03 07:56:48 +02:00
Martino Facchin 8cab209ef9 [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 2e328bae3b [HID] Code cleanup (no semantic changes) 2015-10-02 11:59:23 +02:00
Cristian Maglie bad9b58ce3 [PUSB] Fixed checks on return values 2015-10-02 11:59:23 +02:00
Cristian Maglie 10512b3f9b [USB] Fixed some compiler warnings 2015-10-02 11:59:23 +02:00
Cristian Maglie cabae13e55 [PUSB] Fixed the correct number of endpoints 2015-10-02 11:59:23 +02:00
Cristian Maglie e42d7d6221 [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 c0f9296ae5 [PUSB] No more static fields in PluggableUSB class 2015-10-02 11:59:23 +02:00
Cristian Maglie 27c1832aca [PUSB] The latest fields are now set via constructor 2015-10-02 11:59:23 +02:00
Cristian Maglie 9065229595 [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 7fee0f0a75 [PUSB] replaced u8 with uint8_t 2015-10-02 11:59:22 +02:00
Cristian Maglie 34a75d9416 [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 c07f988609 [PUSB] Global functions PUSB_* are now methods of PluggableUSB class 2015-10-02 11:59:22 +02:00
Cristian Maglie 7302965552 [PUSB] PUSBCallback struct has been merged into PUSBListNode
This slightly simplifies PluggableUSB API.
2015-10-02 11:59:22 +02:00
Nico d2a52bc2ac Removed not used PUSB_Begin() 2015-09-29 17:02:07 +02:00
Cristian Maglie 1bfae1d7d5 [HID] Removed unused PUSBReturn structure 2015-09-28 17:05:35 +02:00
Nico b53611a0d1 Removed not needed Timer warning
Timer is declared above, so nothing is missing here.
2015-09-28 16:30:40 +02:00
Nico 5ab6edb114 Removed Timer warnings when Timer 2 is not present 2015-09-28 16:30:40 +02:00
Nico a7edf4d66f Remove Compiler Warning in Tone.cpp 2015-09-28 16:30:39 +02:00
Nico 1be98bd7d5 Fix compiler warning in CDC.cpp 2015-09-28 16:30:39 +02:00
Nico 948c73c5e3 Fix compiler warnings in USBCore.cpp 2015-09-28 16:30:39 +02:00
Martino Facchin d3f399fad5 Merge pull request #3864 from facchinm/pulseInLongOVF
fix pulseInLong considering overflow
2015-09-25 16:05:35 +02:00
Cristian Maglie aba020da75 Fixed another regression in IPAddress.h
If the includer tries to inlcude IPAddress.h without first including
WString.h the build will fail.
2015-09-24 15:52:32 +02:00
Cristian Maglie 987b9bf2a8 Merge branch 'patch-7' of https://github.com/NicoHood/Arduino 2015-09-21 12:03:26 +02:00
Martino Facchin e5685758e3 fix pulseInLong considering overflow
fixes #3830
2015-09-21 11:59:20 +02:00
Martino Facchin dc04933aa9 pulseInLong: fix incorrect timeout handling 2015-09-21 10:24:48 +02:00
Nico 7f2ca6ee28 Fix CDC Serial buffer size determination 2015-09-20 11:08:49 +02:00
Nico edcfdba42d Fix HW Serial buffer size determination 2015-09-20 11:07:19 +02:00
Cristian Maglie e42c3ccbdb Merge branch 'ethernet-dns-fix' of https://github.com/cmaglie/Arduino 2015-09-18 11:30:45 +02:00
Cristian Maglie 4d234a550c Fixed wrong condition in turnOffPWM(..)
Fix #2163
2015-09-18 11:01:08 +02:00