Commit Graph

250 Commits

Author SHA1 Message Date
Sandeep Mistry af0e712b12 Cleanup some Stream compiler warnings from #3337 2015-11-23 16:45:29 -05:00
Chris--A 699041da60 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 02909a5d39 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 f536bf5ced 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 ca8417e8bd 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 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
Nico 4cbaa304fb [PUSB] Minor Style change 2015-10-09 22:10:45 +02:00
Cristian Maglie 8b6b796f94 [HID] Improved checks in getDescriptor() method 2015-10-08 16:38:57 +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 b2e48cd627 Small return value error check correction 2015-10-07 12:39:18 +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 f9e6ef1913 [HID] Code cleanup (no semantic changes) 2015-10-02 11:59:23 +02:00
Cristian Maglie efe6bc0b7b [PUSB] Fixed checks on return values 2015-10-02 11:59:23 +02:00
Cristian Maglie 631e056806 [USB] Fixed some compiler warnings 2015-10-02 11:59:23 +02:00
Cristian Maglie 3cce436602 [PUSB] Fixed the correct number of endpoints 2015-10-02 11:59:23 +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
Nico e4a5f61c53 Removed not needed Timer warning
Timer is declared above, so nothing is missing here.
2015-09-28 16:30:40 +02:00
Nico 7410817148 Removed Timer warnings when Timer 2 is not present 2015-09-28 16:30:40 +02:00
Nico ab06fbcbf4 Remove Compiler Warning in Tone.cpp 2015-09-28 16:30:39 +02:00
Nico a9005c7627 Fix compiler warning in CDC.cpp 2015-09-28 16:30:39 +02:00
Nico 021c79b372 Fix compiler warnings in USBCore.cpp 2015-09-28 16:30:39 +02:00
Martino Facchin a68800a9dc Merge pull request #3864 from facchinm/pulseInLongOVF
fix pulseInLong considering overflow
2015-09-25 16:05:35 +02:00
Cristian Maglie e160f67fdf 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 e3d0628765 Merge branch 'patch-7' of https://github.com/NicoHood/Arduino 2015-09-21 12:03:26 +02:00
Martino Facchin 3d8b58a72e fix pulseInLong considering overflow
fixes #3830
2015-09-21 11:59:20 +02:00
Martino Facchin 2d797cc1de pulseInLong: fix incorrect timeout handling 2015-09-21 10:24:48 +02:00
Nico 3f854e723d Fix CDC Serial buffer size determination 2015-09-20 11:08:49 +02:00
Nico 6c0439d1c0 Fix HW Serial buffer size determination 2015-09-20 11:07:19 +02:00
Cristian Maglie cf77bfa352 Merge branch 'ethernet-dns-fix' of https://github.com/cmaglie/Arduino 2015-09-18 11:30:45 +02:00
Cristian Maglie fc0659453d Fixed wrong condition in turnOffPWM(..)
Fix #2163
2015-09-18 11:01:08 +02:00
Cristian Maglie 10a0bc3f14 Added IPAddress::fromString(....) function 2015-09-09 12:03:29 +02:00
Cristian Maglie 75489eef94 ...and also a leading ','... (oops 2)
See #2408
2015-09-01 10:58:48 +02:00
Cristian Maglie f9af55125e Added missing #ifdef in WInterrupts.c... (oops)
See #2408
2015-09-01 10:11:43 +02:00
Cristian Maglie bfe2a2928c Added EXTERNAL_NUM_INTERRUPTS for AVR xxU2 series 2015-08-31 18:12:13 +02:00
Andrew J. Kroll 55276c9700 AVR: Faster Interrupts, no size change.
Fixes #2408
2015-08-31 13:55:07 +02:00
onovy c0c69e38ed Tone: Added missing break 2015-08-15 21:11:52 +02:00