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

View File

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