Commit Graph

14 Commits

Author SHA1 Message Date
Dirk O. Kaar
4204869ec9
Extend Print class for 64bit integers. (#3688)
* Extend Print class for 64bit integers.

modulo 32bit and 64bit tuned for code size.

* Fix 32bit long used in long long printNumber.
2020-09-30 14:31:36 +03:00
Me No Dev
5f77b0108b
Fix return of Print::print(timeinfo, format) (#3189) 2019-09-09 00:36:30 +03:00
Tijs van Roon
717ca79ecb #3181 printf double vsnprintf() fix, malloc, va_end (#3184)
* Use loc_buf for small strings, check for error return from vsnprintf

* cleanup arg when bailing out of new

* Use malloc/free instead of new/delete in printf

* Return actual bytes written in printf

* FIX: write before free
2019-09-08 23:49:32 +03:00
Mike Dunston
007a93ec7e Update Print.cpp (#3060)
#2891
2019-08-20 16:36:04 +03:00
atanisoft
39836f12df correct bounds checking in Print::printf to avoid corner case of len=64 (#2204) 2018-12-16 17:09:26 +01:00
Martin Sloup
67128fcb2c Fixes implementation of __FlashStringHelper (#183)
Previous __FlashStringHelper implementation was defines as a char which brought problem in case the method with char* parameter used overloading with __FlashStringHelper* parameter (they was identical). Now __FlashStringHelper is defined as a class and all casts between char* and __FlashStringHelper* are made with reinterpret_cast sugar.
2017-02-08 19:57:26 +02:00
me-no-dev
c8140f8288 add configTime, getLocalTime and support for time in Print
example:
```cpp
//done once on WiFi init
configTime(-7200, 3600, "pool.ntp.org");
//get local time
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
    Serial.println("Failed to obtain time");
    return;
}
//print time
Serial.println(&timeinfo);
//print time with different format
Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");
```
fixes: https://github.com/espressif/arduino-esp32/issues/29
2017-01-24 04:07:27 +02:00
me-no-dev
5d61d8ddd0 copy va_list in Print::printf 2016-10-11 11:42:47 +03:00
me-no-dev
e7d2c18742 Do not delete printf buffer if not required 2016-10-10 19:29:25 +03:00
me-no-dev
01961ef5c6 use local buffer for printf if size is equal or less than 64 2016-10-10 17:37:34 +03:00
me-no-dev
063b563079 Print::printf should allocate it's buffer 2016-10-08 00:18:12 +03:00
me-no-dev
bb9ded7ed4 comment out __FlashStringHelper methods in Print 2016-10-07 23:59:24 +03:00
me-no-dev
03f5d62323 Wiring.h -> Arduino.h 2016-10-06 07:09:45 -06:00
me-no-dev
5f3a205955 initial import 2016-10-06 07:09:44 -06:00