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 11StreamUtils - Change log
22========================
33
4+ HEAD
5+ ----
6+
7+ * Add support for ` Print::flush() ` on ESP32
8+
491.6.3 (2022/05/11)
510-----
611
Original file line number Diff line number Diff line change @@ -19,4 +19,7 @@ target_include_directories(Esp32Core
1919target_compile_definitions (Esp32Core
2020 PUBLIC
2121 ARDUINO_ARCH_ESP32
22+ ESP_ARDUINO_VERSION_MAJOR=2
23+ ESP_ARDUINO_VERSION_MINOR=0
24+ ESP_ARDUINO_VERSION_PATCH=5
2225)
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ struct Print {
1313 virtual ~Print () {}
1414 virtual size_t write (const uint8_t *buffer, size_t size) = 0;
1515 virtual size_t write (uint8_t data) = 0;
16+ virtual void flush () {}
1617
1718 virtual int availableForWrite () {
1819 return 0 ;
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ struct Stream : Print {
1212 virtual int available () = 0;
1313 virtual int read () = 0;
1414 virtual int peek () = 0;
15- virtual void flush () = 0;
1615
1716 virtual size_t readBytes (char *buffer, size_t length) {
1817 size_t count = 0 ;
Original file line number Diff line number Diff line change 55#pragma once
66
77#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)
1012#define STREAMUTILS_PRINT_FLUSH_EXISTS 1
1113#else
1214#define STREAMUTILS_PRINT_FLUSH_EXISTS 0
You can’t perform that action at this time.
0 commit comments