diff --git a/cores/esp8266/Print.cpp b/cores/esp8266/Print.cpp index 2870f3f87b..ff640edae1 100644 --- a/cores/esp8266/Print.cpp +++ b/cores/esp8266/Print.cpp @@ -45,7 +45,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) { size_t n = 0; while (size--) { - size_t ret = write(*buffer++); + size_t ret = write(pgm_read_byte(buffer++)); if (ret == 0) { // Write of last byte didn't complete, abort additional processing break; diff --git a/cores/esp8266/Print.h b/cores/esp8266/Print.h index fdd20fda32..e620f14ade 100644 --- a/cores/esp8266/Print.h +++ b/cores/esp8266/Print.h @@ -56,7 +56,7 @@ class Print { size_t write(const char *str) { if(str == NULL) return 0; - return write((const uint8_t *) str, strlen(str)); + return write((const uint8_t *) str, strlen_P(str)); } virtual size_t write(const uint8_t *buffer, size_t size); size_t write(const char *buffer, size_t size) { diff --git a/cores/esp8266/uart.cpp b/cores/esp8266/uart.cpp index 6794c3358f..30b375cbad 100644 --- a/cores/esp8266/uart.cpp +++ b/cores/esp8266/uart.cpp @@ -495,7 +495,7 @@ uart_write(uart_t* uart, const char* buf, size_t size) size_t ret = size; const int uart_nr = uart->uart_nr; while (size--) - uart_do_write_char(uart_nr, *buf++); + uart_do_write_char(uart_nr, pgm_read_byte(buf++)); return ret; }