File tree Expand file tree Collapse file tree 5 files changed +13
-3
lines changed Expand file tree Collapse file tree 5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
StreamUtils - Change log
2
2
========================
3
3
4
+ HEAD
5
+ ----
6
+
7
+ * Add support for ` Print::flush() ` on ESP32
8
+
4
9
1.6.3 (2022/05/11)
5
10
-----
6
11
Original file line number Diff line number Diff line change @@ -19,4 +19,7 @@ target_include_directories(Esp32Core
19
19
target_compile_definitions (Esp32Core
20
20
PUBLIC
21
21
ARDUINO_ARCH_ESP32
22
+ ESP_ARDUINO_VERSION_MAJOR=2
23
+ ESP_ARDUINO_VERSION_MINOR=0
24
+ ESP_ARDUINO_VERSION_PATCH=5
22
25
)
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ struct Print {
13
13
virtual ~Print () {}
14
14
virtual size_t write (const uint8_t *buffer, size_t size) = 0;
15
15
virtual size_t write (uint8_t data) = 0;
16
+ virtual void flush () {}
16
17
17
18
virtual int availableForWrite () {
18
19
return 0 ;
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ struct Stream : Print {
12
12
virtual int available () = 0;
13
13
virtual int read () = 0;
14
14
virtual int peek () = 0;
15
- virtual void flush () = 0;
16
15
17
16
virtual size_t readBytes (char *buffer, size_t length) {
18
17
size_t count = 0 ;
Original file line number Diff line number Diff line change 5
5
#pragma once
6
6
7
7
#ifndef STREAMUTILS_PRINT_FLUSH_EXISTS
8
- #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_SAMD) || \
9
- defined (ARDUINO_ARCH_AVR)
8
+ #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_SAMD) || \
9
+ defined (ARDUINO_ARCH_AVR) || \
10
+ (defined(ARDUINO_ARCH_ESP32) && ESP_ARDUINO_VERSION_MAJOR >= 2 && \
11
+ ESP_ARDUINO_VERSION_PATCH >= 3)
10
12
#define STREAMUTILS_PRINT_FLUSH_EXISTS 1
11
13
#else
12
14
#define STREAMUTILS_PRINT_FLUSH_EXISTS 0
You can’t perform that action at this time.
0 commit comments