Fix oled.

This commit is contained in:
Brad Nelson
2021-03-04 13:40:55 -08:00
parent f2ffcae3f7
commit 705f04d37e
2 changed files with 7 additions and 6 deletions

View File

@ -21,7 +21,7 @@
// Adafruit SSD1306
// Adafruit GFX Library
// Adafruit BusIO
// #define ENABLE_OLED_SUPPORT
//#define ENABLE_OLED_SUPPORT
// For now assume only boards with PSRAM (ESP32-CAM)
// will want SerialBluetooth (very large) and camera support.
@ -338,8 +338,8 @@ static cell_t FromIP(IPAddress ip) {
# include <Adafruit_SSD1306.h>
static Adafruit_SSD1306 *oled_display = 0;
# define OPTIONAL_OLED_SUPPORT \
Y(OledAddr, PUSH oled_display) \
Y(OledNew, oled_display = new Adafruit_SSD1306 display(n2, n1, &Wire, n0) DROPn(3)) \
Y(OledAddr, PUSH &oled_display) \
Y(OledNew, oled_display = new Adafruit_SSD1306(n2, n1, &Wire, n0); DROPn(3)) \
Y(OledDelete, delete oled_display) \
Y(OledBegin, n0 = oled_display->begin(n1, n0); NIP) \
Y(OledHOME, oled_display->setCursor(0,0); DROP) \

View File

@ -111,8 +111,8 @@ transfer{
OledRect OledRectF OledRectR OledRectrf
}transfer
128 constant width
64 constant height
128 constant WIDTH
64 constant HEIGHT
-1 constant OledReset
0 constant BLACK
1 constant WHITE
@ -120,7 +120,8 @@ transfer{
2 constant SSD1306_SWITCHCAPVCC
: OledInit
OledAddr @ 0= if
OledNew SSD1306_SWITCHCAPVCC $3C OledBegin drop
WIDTH HEIGHT OledReset OledNew
SSD1306_SWITCHCAPVCC $3C OledBegin drop
then
OledCLS
2 OledTextsize ( Draw 2x Scale Text )