mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Add explicit Print::write(char) (#6101)
W/o this change, file::write('a'); tries to use the template and fails since char is a basic type. The reason it is needed is due to pre 2.5.x behavior, File::write(char) silently was cast to File::write(uint8_t). With the template write, though, this is not performed. * Add Print::write tests and add'l overrides Ensure that print::write does something sane and doesn't cause a compile time error about templates when used for Files. Test using SPIFFS file since Print is an abstract type.
This commit is contained in:
committed by
GitHub
parent
48fc8aff20
commit
82adc95d64
@ -80,10 +80,6 @@ class TwoWire : public Stream
|
||||
void onReceive( void (*)(size_t) ); // legacy esp8266 backward compatibility
|
||||
void onRequest( void (*)(void) );
|
||||
|
||||
inline size_t write(unsigned long n) { return write((uint8_t)n); }
|
||||
inline size_t write(long n) { return write((uint8_t)n); }
|
||||
inline size_t write(unsigned int n) { return write((uint8_t)n); }
|
||||
inline size_t write(int n) { return write((uint8_t)n); }
|
||||
using Print::write;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user