Commit Graph

25 Commits

Author SHA1 Message Date
Chuck Todd 98f7ab1588 Print not Aborting on Write() failure
Print::write(const uint8_t *buffer, size_t size) and Print::print(const
__FlashStringHelper *ifsh) would continue calling write(char) after a
failed write(char) this behavior would render returned count unuseable
see arduino/Arduino issue #3614
2015-08-12 11:47:57 +02:00
Chris--A 7562af1752 Optimize printLn calls. 2015-05-22 23:00:07 +10:00
Cristian Maglie bf37051397 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 1978e82e4e Use PGM_P instead of prog_char
On later versions of avr-libc, prog_char is deprecated. In 0acebeeff48
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 1130fede3a2 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
Kristian Lauszus ad9f78d727 Use reinterpret_cast to cast __FlashStringHelper to const char* 2013-12-27 20:01:03 +01:00
Matthijs Kooijman 94cf4c2830 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
Federico Fissore dce9146485 Print.print optimization. Closes #1760 2013-12-23 11:50:39 +01:00
Federico Fissore c453e0a32e fixed permissions on a lot of text files. see #1116 2012-12-10 10:42:49 +01:00
Cristian Maglie 037020e938 Merged latest changes in AVR arduino core 2012-10-18 18:47:50 +02:00
David A. Mellis 2ef2f9d5c7 Print "inf" for infinite floating point numbers (using isinf()).
http://code.google.com/p/arduino/issues/detail?id=961
2012-06-23 10:37:35 -05:00
David A. Mellis 3436ca97cb Printing NaN values as "nan" in printFloat().
http://code.google.com/p/arduino/issues/detail?id=946
2012-06-04 23:30:41 -04:00
David A. Mellis a7afdf40ba prog_char -> char PROGMEM in Print.cpp
http://code.google.com/p/arduino/issues/detail?id=795
2012-02-12 19:52:03 -05:00
Zach Eveland 3524f2ff0b Revert "Merge branch 'master' of github.com:arduino/Arduino into diskloader_reboot"
This reverts commit df9835efafd13685251749bc210c0b96a18a96a5, reversing
changes made to ec45af8bfa9222a807c075dd1db4b5aa798bba03.

Conflicts:

	hardware/arduino/variants/mega/pins_arduino.h
	libraries/Ethernet/examples/PachubeClientString/PachubeClientString.ino
2011-10-27 11:45:13 -04:00
David A. Mellis 5e721df32a Fixing warnings (David H. Lynch Jr). 2011-03-03 22:56:20 -05:00
David A. Mellis 4bbd4f7448 Changing String::toCharArray() and getBytes() to accept a buffer, rather than return one. That way they don't expose the internal representation of the String class, allowing future optimization. Thanks to Paul Stoffregen. 2010-08-28 10:23:54 +00:00
David A. Mellis 2c32369685 Adding support for printing Strings to the Print class. 2010-07-04 23:22:34 +00:00
David A. Mellis 85de48989d Adding precision parameter for printing of floats / doubles. Restructured the print() and println() functions a bit. 2009-12-25 20:20:27 +00:00
David A. Mellis 35f5f6e99f Improving third-party hardware support:
- moving back to multple cores per platform
- using target instead of platform
- moving per-board and per-programmer preferences out of Preferences.java and into a new Target class
- adding a new "target" preference
- support for platform:value values in board preferences for bootloader path and core
- XXX: need to support platform:value syntax for board upload.using preferences.
2009-11-21 23:23:43 +00:00
David A. Mellis 584dece7b0 Moving things around. 2009-11-07 17:05:21 +00:00
David A. Mellis 0681fc1f17 Adding write(str) and write(buf, size) methods to Print class and Ethernet library Client and Server classes. This allows sending a whole string or buffer at once, reducing the number of ethernet packets. 2009-04-26 13:10:34 +00:00
David A. Mellis d7500ba228 fixing / improving printFloat() from Mikal Hart 2009-01-25 15:44:17 +00:00
David A. Mellis 1d86178387 Adding support for printing floats and doubles (defaulting to 2 decimal places) 2008-11-26 14:15:24 +00:00
David A. Mellis 79904311bb Wire library patch to provide better error handling. 2008-06-21 23:16:27 +00:00
David A. Mellis 4b2b39e383 Changing Print class to use regular virtual write() function (instead of my hack
ed together version).
2008-05-07 18:24:49 +00:00
David A. Mellis 5412a33feb Adding the Print class. 2008-04-18 18:46:52 +00:00