File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -238,14 +238,14 @@ size_t Print::printFloat(double number, uint8_t digits)
238
238
239
239
// Print the decimal point, but only if there are digits beyond
240
240
if (digits > 0 ) {
241
- n += print (" . " );
241
+ n += print (' . ' );
242
242
}
243
243
244
244
// Extract digits from the remainder one at a time
245
245
while (digits-- > 0 )
246
246
{
247
247
remainder *= 10.0 ;
248
- unsigned int toPrint = (unsigned int )remainder ;
248
+ unsigned int toPrint = (unsigned int )( remainder ) ;
249
249
n += print (toPrint);
250
250
remainder -= toPrint;
251
251
}
Original file line number Diff line number Diff line change 28
28
#define DEC 10
29
29
#define HEX 16
30
30
#define OCT 8
31
+ #ifdef BIN // Prevent warnings if BIN is previously defined in "iotnx4.h" or similar
32
+ #undef BIN
33
+ #endif
31
34
#define BIN 2
32
35
33
36
class Print
@@ -54,6 +57,10 @@ class Print
54
57
return write ((const uint8_t *)buffer, size);
55
58
}
56
59
60
+ // default to zero, meaning "a single write may block"
61
+ // should be overriden by subclasses with buffering
62
+ virtual int availableForWrite () { return 0 ; }
63
+
57
64
size_t print (const __FlashStringHelper *);
58
65
size_t print (const String &);
59
66
size_t print (const char []);
@@ -78,6 +85,8 @@ class Print
78
85
size_t println (double , int = 2 );
79
86
size_t println (const Printable&);
80
87
size_t println (void );
88
+
89
+ virtual void flush () { /* Empty implementation for backward compatibility */ }
81
90
};
82
91
83
92
#endif
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ class Stream : public Print
59
59
virtual int available () = 0;
60
60
virtual int read () = 0;
61
61
virtual int peek () = 0;
62
- virtual void flush () = 0;
63
62
64
63
Stream () {_timeout=1000 ;}
65
64
You can’t perform that action at this time.
0 commit comments