From 705f04d37eecb8fb8cba0f71de7f8445e6cd92a7 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Thu, 4 Mar 2021 13:40:55 -0800 Subject: [PATCH] Fix oled. --- ueforth/arduino/arduino.template.ino | 6 +++--- ueforth/arduino/bindings.fs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ueforth/arduino/arduino.template.ino b/ueforth/arduino/arduino.template.ino index d7b74aa..450756a 100644 --- a/ueforth/arduino/arduino.template.ino +++ b/ueforth/arduino/arduino.template.ino @@ -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 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) \ diff --git a/ueforth/arduino/bindings.fs b/ueforth/arduino/bindings.fs index bd42c93..1ee9071 100644 --- a/ueforth/arduino/bindings.fs +++ b/ueforth/arduino/bindings.fs @@ -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 )