Skip to content

Commit 5f31ffe

Browse files
committed
Merge branch 'master' into me-no-dev
2 parents f6c4516 + c82699a commit 5f31ffe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libraries/Wire/src/Wire.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
#include <esp32-hal.h>
2828
#include "freertos/FreeRTOS.h"
2929
#include "freertos/queue.h"
30+
#include "Stream.h"
3031

3132
#define I2C_BUFFER_LENGTH 128
3233

33-
class TwoWire
34+
class TwoWire: public Stream
3435
{
3536
protected:
3637
uint8_t num;
@@ -71,6 +72,10 @@ class TwoWire
7172
int peek(void);
7273
void flush(void);
7374

75+
inline size_t write(const char * s)
76+
{
77+
return write((uint8_t*) s, strlen(s));
78+
}
7479
inline size_t write(unsigned long n)
7580
{
7681
return write((uint8_t)n);
@@ -92,4 +97,3 @@ class TwoWire
9297
extern TwoWire Wire;
9398

9499
#endif
95-

0 commit comments

Comments
 (0)