Commit Graph

1253 Commits

Author SHA1 Message Date
Cristian Maglie 1fab8c85e6 Slightly reduce code utilization by inlining HardwareSerail begin(baud) and operator bool() 2014-01-16 13:50:59 +01:00
Matthijs Kooijman f35ec75dce Remove duplicate code from HardwareSerial::begin() methods.
There are two begin methods, one which accepts just a baud rate and
uses the default bit settings and one which accepts both a baudrate and
a bit config. Previously, both of these contained a complete
implementation, but now the former just calls the latter, explicitely
passing the default 8N1 configuration.

Technically, this causes a small change: Before the UCSRC register was
untouched when calling begin(baud), now it is explicitely initialized
with 8N1. However, since this is the default configuration for at least
the Uno and the Mega (didn't check any others), probably for all avrs,
this shouldn't effectively change anything. Given that the Arduino
documentation also documents this as the default when none is passed,
explicitly setting it is probably a good idea in any case.
2014-01-16 13:20:11 +01:00
Matthijs Kooijman dde1a7541f Make some operators in IPAddress const
These functions do not modify the IPAddress object, but were not marked
as const. This meant that you could not do:

void set_ip(const IPAddress& ip) {
	uint32_t copy = ip;
}

Since calling operator uint32_t() on ip would discard the constness of
the reference.
2014-01-15 16:20:48 +01:00
Cristian Maglie 8595d1444c Merge pull request #1790 from cmaglie/platform-paths
Fixed "runtime.hardware.path" and "runtime.platform.path" values
2014-01-09 04:30:00 -08:00
Federico Fissore dfe77f388d Removed = char from #define. See https://github.com/arduino/Arduino/issues/1792#issuecomment-31650586 2014-01-06 18:20:37 +01:00
Federico Fissore 9fce7f1839 Added new EULER constant. Fixes #1792 2014-01-06 09:48:34 +01:00
Cristian Maglie 4dc21cee6c Fixed "runtime.hardware.path" and "runtime.platform.path" values
"runtime.hardware.path" now contains the path to the hardware folder
of the currently selected board and "runtime.platform.path" the path
to the specific platform.

This should fix #1176 and #1761.
2014-01-05 12:42:27 +01:00
Cristian Maglie 673847c8b6 Improved portability of String class (maniacbug) 2014-01-01 17:22:40 +01:00
Cristian Maglie e2d373ed61 sam: Added digitalPinHasPWM(..) method
Fixes #1342
2013-12-31 20:58:10 +01:00
Cristian Maglie 90ab663146 sam: moved "variant" methods into proper place 2013-12-31 20:57:14 +01:00
Cristian Maglie c50821ba10 Fixed value of NUM_DIGITAL_PINS for Arduino Due 2013-12-31 20:55:43 +01:00
Cristian Maglie ffddfc81f6 Merge branch 'cast' of github.com:Lauszus/Arduino into Lauszus-cast
Conflicts:
	hardware/arduino/avr/cores/arduino/Print.cpp
2013-12-31 20:11:08 +01:00
Matthijs Kooijman 98777e816f Use PGM_P instead of prog_char
On later versions of avr-libc, prog_char is deprecated. In 0acebeeff4
the one occurence of prog_char was replaced by "char PROGMEM", which is
not entirely correct (PROGMEM is supposed to be an attribute on a
variable, not on a type, even though this is how things work in older
libc versions). However, in 1130fede3a a few new occurences of
prog_char are introduced, which break compilation on newer libc versions
again.

This commit changes all these pointer types to use the PGM_P macro from
<avr/pgmspace.h>. This macro is just "const char *" in newer libc
versions and "const prog_char *" in older versions, so it should always
work.

References #795
2013-12-31 20:01:40 +01:00
Cristian Maglie 0b72c88b42 Merge pull request #1762 from matthijskooijman/ide-1.5.x-write-char
Support both char* and uint8* in Stream and Print
2013-12-30 10:58:03 -08:00
Cristian Maglie 825d8c8455 sam: Optimized delayMicroseconds() (Rob Tillaart)
See #1121
2013-12-30 12:17:50 +01:00
Kristian Lauszus 5d361f5f47 Use reinterpret_cast to cast __FlashStringHelper to const char* 2013-12-27 20:01:03 +01:00
Matthijs Kooijman 2ea12d0220 Remove unneeded casts in Print::write(const String&)
Now that Print::write(const char*) is also available, these casts are no
longer needed.
2013-12-24 13:22:43 +01:00
Matthijs Kooijman f304abe35f Add uint8_t* versions of methods in Stream
The new functions just call their char* equivalents, but this allows
reading bytes into a buffer of uint8_t as well as chars.
2013-12-24 13:22:42 +01:00
Matthijs Kooijman 250386802f Add Print::write(const char *, size_t)
The new function just calls Print::write(const uint8_t *, size_t), but
this allows writing out a buffer of chars (without having to learn about
casts).
2013-12-24 13:22:42 +01:00
Cristian Maglie 660c7d86fd Optimized Print::print(String&) (part 2) 2013-12-23 12:04:15 +01:00
Federico Fissore 88a2ca18fd Print.print optimization. Closes #1760 2013-12-23 11:50:39 +01:00
Cristian Maglie b530742603 [sam] Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson)
See #1740 #1634

http://forum.arduino.cc/index.php?topic=203322.msg1509907#msg1509907
2013-12-18 15:46:42 +01:00
Cristian Maglie a1c4809105 [sam] Fixed regression in analogRead() (fails to read multiple channels)
Fixes #1740
2013-12-16 11:07:45 +01:00
Cristian Maglie 2e7b645571 [sam] Fixed wrap-around bug in delay() (Mark Tillotson)
Fixes #1736
2013-12-14 00:33:57 +01:00
Cristian Maglie e2b15c852b Changed pins definition in variants from constants to #defines. 2013-12-13 15:13:18 +01:00
Cristian Maglie c5880c2c1b Merge branch 'pins-define' into ide-1.5.x 2013-12-13 15:09:40 +01:00
Cristian Maglie 7fcba37acf Changed pins definition in variants from constants to #defines. 2013-12-13 14:37:26 +01:00
Cristian Maglie f9bbcab1a3 Removed redefinitions of SERIAL_* in Yun variant 2013-12-13 14:22:46 +01:00
Matthijs Kooijman 76645b957d In boards.txt, rename atmega328diecimila to diecimila
This board has a "cpu" submenu to select either atmega328 or atmega168,
so it does not make sense to put atmega328 in the main board name.
2013-12-08 18:16:31 +01:00
Cristian Maglie 43f9f15358 Upped version to 1.5.5 2013-11-28 10:53:50 +01:00
ntruchsess 937bce1a0b add localPort to EthernetClient, simplify operator== 2013-11-27 10:40:57 +01:00
ntruchsess ca37de4ba4 add operator==, remoteIP and remotePort to EthernetClient 2013-11-26 00:12:44 +01:00
Cristian Maglie d5c828736b Revert "SPI library to new format" 2013-11-21 15:05:36 +01:00
Cristian Maglie ff24874117 Revert "EEPROM library to the new format"
This reverts commits:
3223d4fdca
77f8dd63ab
2013-11-21 11:22:44 +01:00
Cristian Maglie 71bb7f7ae3 Fixed vid/pid definition for arduino_due_x_dbg in boards.txt. (Luca Baldini)
http://forum.arduino.cc/index.php?topic=197003
2013-11-15 14:01:36 +01:00
Cristian Maglie 7f17170678 Revert "SoftwareSerial library to the new format"
This reverts commit 38c3bbbd3c.
2013-11-15 12:54:59 +01:00
Cristian Maglie 9a9652d506 Revert "Wire library to the 1.5 format"
This reverts commit a31857688b.
2013-11-15 12:54:59 +01:00
Cristian Maglie 41697f02b2 Removed redundant LED_BUILTIN define in Yun variant. 2013-11-12 14:31:51 +01:00
Cristian Maglie 3ba9480972 Merge pull request #1634 from cmaglie/adc-fix
Improved ADC speed on Arduino Due
2013-11-12 00:57:28 -08:00
Cristian Maglie edfa75f979 Merge branch 'master' into serial-variant 2013-11-11 14:01:09 +01:00
Cristian Maglie e30418072d Fix SERIAL_* metadata in Arduino Ethernet variant 2013-11-11 13:54:50 +01:00
Cristian Maglie 56572fa0de Added SERIAL metadata into variant files. 2013-11-11 13:41:04 +01:00
Cristian Maglie 78abc567d1 Merge branch 'master' into serial-variant 2013-11-11 13:03:21 +01:00
Cristian Maglie e7c24c66a9 Added SERIAL metadata into variant files. 2013-11-11 11:39:37 +01:00
Kristian Lauszus 42a0096682 Added VID and PID for older Arduino Unos 2013-11-11 02:41:44 +01:00
Cristian Maglie 8e3da56624 Added LED_BUILTIN definition to Arduino Due 2013-11-03 18:29:34 +01:00
Cristian Maglie 3607c0b2bd Merge branch 'master' into ide-1.5.x 2013-11-03 18:18:09 +01:00
Cristian Maglie 9b519f2fbc Changed LED_BUILTIN to a macro to better support boards that do not have a built-in LED.
Fixes #758
2013-11-03 18:10:22 +01:00
Cristian Maglie 350eb86dca Added LED_BUILTIN constant to Leonardo board 2013-11-03 18:07:01 +01:00
Cristian Maglie cdf9db82a9 Merge branch 'master' into ide-1.5.x 2013-11-03 14:00:42 +01:00