Skip to content

Commit 553c01a

Browse files
Fix oled-ssd1306 tag + esp32 build
1 parent c26ce6e commit 553c01a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lib_deps =
1313
arduino-libraries/LiquidCrystal @ ^1.0.7
1414
lincomatic/LiquidTWI2@^1.2.7
1515
olikraus/U8g2@^2.28.8
16-
https://github.com/ClutchplateDude/esp8266-oled-ssd1306#4.6.0
16+
https://github.com/ClutchplateDude/esp8266-oled-ssd1306#4.6.2
1717

1818
[env]
1919
extra_scripts =

src/SSD1306_128x64_Display.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
#include "Mount.hpp"
77
#include "InfoDisplayRender.hpp"
88

9+
#if defined(ESP32)
10+
/*
11+
* ESP32 PROGMEM is fake, and its pgm_read_byte macro makes a useless cast
12+
* which errors out with Werror=useless-cast, which can't be suppressed by
13+
* our PUSH/POP_NO_WARNINGS because the macro expands in OUR code, not their
14+
* header :/
15+
*/
16+
#undef pgm_read_byte
17+
#define pgm_read_byte(addr) (*(addr))
18+
#endif
19+
920
const float sineSize = 18.0;
1021
const uint8_t sineTable[] PROGMEM = {0, 22, 44, 66, 87, 108, 128, 146, 164, 180, 195, 209, 221, 231, 240, 246, 251, 254, 255, 255};
1122

0 commit comments

Comments
 (0)