Federico
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
Federico
C
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAlK5i2EACgkQz0nQ5oovr7xcYQCgs9GbYLr1xXLnzTean35DWGWB
5r4AnjnvyMmlBQouBibBIafWG/gpIhit
=z5IE
-----END PGP SIGNATURE-----
Hi Rob,
I've been looking at all your suggested improvements:
In data lunedì 23 dicembre 2013 20:57:54, Rob Tillaart ha scritto:
> 1) improve print performance for all numbers with divmod10 code (avr) -
> no issue -
>
> (A) - http://forum.arduino.cc/index.php?topic=167414.0 - divmod10 code
> (B) - http://forum.arduino.cc/index.php?topic=179111.0 - divmod10 applied
> in the print function.
>
> Together with Darryl, PaulS and others, the performance of print increased
> substantially,
> and as print is a base class for Serial, ethernet etc, the gain will be
> everywhere.
This is a very nice improvement. As you already suggested, we may start by providing a "fast_math.h" that contains all the optimized code for generic math calculations. The fast_math will not be intended for normal usage in user's sketches, but only for core/libary developers to optimize critical parts of code. Moreover we must provide a similar file for every architecture (at least to provide something that fall-back to standard math subroutines).
> 2) printing HEX numbers always with leading zero - issue 1097
> Darryl posted code to print with leading zero's, an item often mentioned on
> the forum.
> see (B) above
AFAIU this patch changes the print(__,HEX) behaviour, breaking existing sketches that relies on printing without leading zeros.
A different solution may be something like the following:
Serial.print(x, HEX, 4) where 4 is the number of digits to print (including leading zeros), as described here:
> 3) Support for SCI and ENG and SI format - related to issue #1412
> Useful for floats especially if bigger than maxlong.
> - http://forum.arduino.cc/index.php?topic=179111.msg1375203#msg1375203 -
I'm not sure I fully understand the difference between the three formats, may you explain it with some examples? This will help to understand the use cases behind this change.
I see also that you handle directly bits in the binary floating point layout (to grab the exponential part from the 32-bit floating point raw data). I know that AVR doesn't support "double", while ARM does, maybe this need to be handled in some way?
I'm wondering if these subroutines deserves a specific library (with other math functions?) instead of trying to push them in the core.
> 4) Support for long long printing - issue #1236
> - http://forum.arduino.cc/index.php?topic=143584.msg1078250#msg1078250 -
> as proposed it is conditional compiled as 64 bit takes quite some space.
Probably we can just add the methods to print int64 since the extra space should be taken only when used.
> 5) (small) memory improvement of the print.cpp lib - issue #1222
I see a bunch of them in the forum thread, I'll try to pick the simplest ones to begin.
C
> 3) Support for SCI and ENG and SI format - related to issue #1412
> Useful for floats especially if bigger than maxlong.
> - http://forum.arduino.cc/index.php?topic=179111.msg1375203#msg1375203 -
I'm not sure I fully understand the difference between the three formats, may you explain it with some examples? This will help to understand the use cases behind this change.
> 5) (small) memory improvement of the print.cpp lib - issue #1222
I see a bunch of them in the forum thread, I'll try to pick the simplest ones to begin.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
Good grief! Aside from using some extra code space, what's the "problem" with standard C [s]printf() syntax? Billions of programmers have been using it for decades, with few
complaints!
For me, as a C programmer from way back (c. 1982), and FORTRAN & assembler (c.1962) a single, simple sprintf(buf,"fmt", varList...)+Serial.print(buf) - IF it supported %[w[.p]]f format spec - would be far easier than having to code multiple sprintf()+Serial.print() calls for everything but floats and (totally different format-spec) Serial.print() calls, just to print one or more floats properly!
On Dec 29, 2013, at 12:09 PM, Knight, Dave <die...@gmail.com> wrote:Good grief! Aside from using some extra code space, what's the "problem" with standard C [s]printf() syntax? Billions of programmers have been using it for decades, with fewcomplaints!
For me, as a C programmer from way back (c. 1982), and FORTRAN & assembler (c.1962) a single, simple sprintf(buf,"fmt", varList...)+Serial.print(buf) - IF it supported %[w[.p]]f format spec - would be far easier than having to code multiple sprintf()+Serial.print() calls for everything but floats and (totally different format-spec) Serial.print() calls, just to print one or more floats properly!
Right, but what about for someone who’s *not* a C programmer?
What are we even talking about at this point? Is there a proposal on the table?
Remember, as I noted in my last post, it's all avr-gcc under the hood (so far as AVR cores go) so feel free to use standard libs to your heart's content...
Regards,
Vic
What are we even talking about at this point? Is there a proposal on the table?
Remember, as I noted in my last post, it's all avr-gcc under the hood (so far as AVR cores go) so feel free to use standard libs to your heart's content...
Thanks Paul. What is the downside to adding a printf method to the Print class that simply exposes / wraps the stdlib sprintf method? Beginners need not use it, and for advanced users it can hide those three pesky lines of code / buffers in the object.
Regards,
Vic
Thanks Paul. What is the downside to adding a printf method to the Print class that simply exposes / wraps the stdlib sprintf method? Beginners need not use it, and for advanced users it can hide those three pesky lines of code / buffers in the object.
Well, the likely downside for novice users is more people will tend to publish examples on the playground and numerous websites using complex syntax like Serial.printf("%-lu",u32) rather than simple syntax like Serial.print(u32). Novices depend heavily upon easy examples and well designed libraries.
Then again, some people already publish widely used libraries with examples using printf (notably maniacbug) and the C++ streams syntax (notably sdfatlib). The reality is some of the very best and most widely used Arduino library are developed by experienced programmers who favor the compactness (in lines of source) printing formats, even in their examples meant for novices.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAlLCt28ACgkQz0nQ5oovr7x0DQCggddutACInfr+a7PQFu1Ax33l
+1MAoIHpOaY22WrDEBhTPgktFKO4UQby
=INok
-----END PGP SIGNATURE-----
On Dec 31, 2013 10:23 AM, "Rob Tillaart" <rob.ti...@gmail.com> wrote:
>
>
> Improved documentation would be a nice goal for 2014!
>
> -------------------------------
>
> I agree with Tom Igoe that Arduino should be usable for everyone without skills and willing to learn. 8-10 year old kids should be able to start tinkering.
>
Just thinking out loud, one way to make this happen would be to require that all submitted patches include documentation that conforms to the guide for docs and is reviewed by someone from the teacher's list....
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAlLC6jcACgkQz0nQ5oovr7wdHACgzNvshWw9C44oDuaOtpdbirVq
JSIAoJp4NNL3QP4tqJUeeo0JOX6EATJy
=I2KU
-----END PGP SIGNATURE-----
-Wl,-u,vfprintf -lprintf_flt -l
which I would gladly do, but thus far, I have not found a straightforward way to "pass flags to gcc" (e.g. an option in preferences.txt), in the Arduino Docs or elsewhere.| char* dtostrf | ( | double | __val, |
| signed char | __width, | ||
| unsigned char | __prec, | ||
| char * | __s | ||
| ) |
################ Wed Jan 1 14:36:59 EST 2014
Alive ? sec
Alive 5.002 sec
Alive ? sec
Alive 6.002 sec
Alive ? sec
Alive 7.003 sec
Alive ? sec
Alive 8.003 sec
Alive ? sec
Alive 9.004 sec
Alive ? sec
Alive 10.004 sec
Alive ? sec
Alive 11.004 sec
Alive ? sec
Alive 12.005 sec
Good idea. I'll makes those links when I'm on a keyboard.
T.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAlLLwRMACgkQz0nQ5oovr7wjcgCfaIjrdAGLEpas3mg9Dmt8j4xv
VkYAoOJcqL1ppe64JHnS+I56uhRCSPS5
=xaEZ
-----END PGP SIGNATURE-----