Defensive code for Heltec Display (#1296)

Added to Heltec board display code logic to reduce corruption of messages on the display

Two piece of defensive code were added

- Only display messages to the display when operating on Core 1 ( Default Arduino ESP32 CONFIG_ARDUINO_RUNNING_CORE )

- Only display one character/string at a time

In the event of failure, default to Serial output.

PS SSD1306 driver similar issues

https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/326
https://github.com/ThingPulse/esp8266-oled-ssd1306/issues/352
This commit is contained in:
Northern Man authored and GitHub committed 2022-10-23 13:36:59 -05:00
1 parent 941b1e109f
commit 19d58e01e0
2 files changed
+28 -22

No files matched your search

+6 -1
View File
@@ -87,7 +87,12 @@ public:
void fillScreen(OLEDDISPLAY_COLOR); // fillScreen display and set color
size_t write(uint8_t);
// This is a bit of lazy programmer simplifacation for the semapore and core detecting code. Not sure if it is truly space efficient.
inline size_t write(uint8_t x) {
return write(&x, 1);
}
size_t write(const uint8_t* buffer, size_t size);
inline size_t write(const char* buffer, size_t size) {
return write((uint8_t*)buffer, size);