From c13c7a9fe2053b6b5613d19c01abf6e421629104 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sat, 6 Sep 2025 01:24:36 -0700 Subject: [PATCH] Fixed oled bug, made build more flexible + fix build errors. --- configure.py | 3 +-- esp32/optional/oled/oled.h | 20 ++++++++++---------- web/dump_web_opcodes.c | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/configure.py b/configure.py index 3ea1679..c533e99 100755 --- a/configure.py +++ b/configure.py @@ -42,7 +42,6 @@ CFLAGS_MINIMIZE = [ '-s', '-DUEFORTH_MINIMAL', '-fno-exceptions', - '-ffreestanding', '-fno-stack-protector', '-fomit-frame-pointer', '-fno-ident', @@ -136,7 +135,7 @@ def DetectWindowsTools(args): sys.stderr.write('Windows %LOCALAPPDATA% not available, Windows support disabled.\n') return LOCALAPPDATA = LOCALAPPDATAR.replace('C:/', '/mnt/c/') - ARDUINO_CLI = LOCALAPPDATA + '/Programs/arduino-ide/resources/app/lib/backend/resources/arduino-cli.exe' + ARDUINO_CLI = LSQ(LOCALAPPDATA + '/Programs/*rduino*/resources/app/lib/backend/resources/arduino-cli.exe') WINTMP = LOCALAPPDATA + '/Temp' WINTMPR = LOCALAPPDATAR + '/Temp' PROGFILES = '/mnt/c/Program Files' diff --git a/esp32/optional/oled/oled.h b/esp32/optional/oled/oled.h index 92e0a07..f38441b 100644 --- a/esp32/optional/oled/oled.h +++ b/esp32/optional/oled/oled.h @@ -35,7 +35,7 @@ static Adafruit_SSD1306 *oled_display = 0; YV(oled, OledNew, oled_display = new Adafruit_SSD1306(n2, n1, &Wire, n0); DROPn(3)) \ YV(oled, OledDelete, delete oled_display) \ YV(oled, OledBegin, n0 = oled_display->begin(n1, n0); NIP) \ - YV(oled, OledHOME, oled_display->setCursor(0,0); DROP) \ + YV(oled, OledHOME, oled_display->setCursor(0, 0)) \ YV(oled, OledCLS, oled_display->clearDisplay()) \ YV(oled, OledTextc, oled_display->setTextColor(n0); DROP) \ YV(oled, OledPrintln, oled_display->println(c0); DROP) \ @@ -45,14 +45,14 @@ static Adafruit_SSD1306 *oled_display = 0; YV(oled, OledPrint, oled_display->write(c0); DROP) \ YV(oled, OledInvert, oled_display->invertDisplay(n0); DROP) \ YV(oled, OledTextsize, oled_display->setTextSize(n0); DROP) \ - YV(oled, OledSetCursor, oled_display->setCursor(n1,n0); DROPn(2)) \ - YV(oled, OledPixel, oled_display->drawPixel(n2, n1, n0); DROPn(2)) \ - YV(oled, OledDrawL, oled_display->drawLine(n4, n3, n2, n1, n0); DROPn(4)) \ - YV(oled, OledCirc, oled_display->drawCircle(n3,n2, n1, n0); DROPn(3)) \ - YV(oled, OledCircF, oled_display->fillCircle(n3, n2, n1, n0); DROPn(3)) \ - YV(oled, OledRect, oled_display->drawRect(n4, n3, n2, n1, n0); DROPn(4)) \ - YV(oled, OledRectF, oled_display->fillRect(n4, n3, n2, n1, n0); DROPn(3)) \ - YV(oled, OledRectR, oled_display->drawRoundRect(n5, n4, n3, n2, n1, n0); DROPn(5)) \ - YV(oled, OledRectRF, oled_display->fillRoundRect(n5, n4, n3, n2, n1, n0 ); DROPn(5)) + YV(oled, OledSetCursor, oled_display->setCursor(n1, n0); DROPn(2)) \ + YV(oled, OledPixel, oled_display->drawPixel(n2, n1, n0); DROPn(3)) \ + YV(oled, OledDrawL, oled_display->drawLine(n4, n3, n2, n1, n0); DROPn(5)) \ + YV(oled, OledCirc, oled_display->drawCircle(n3, n2, n1, n0); DROPn(4)) \ + YV(oled, OledCircF, oled_display->fillCircle(n3, n2, n1, n0); DROPn(4)) \ + YV(oled, OledRect, oled_display->drawRect(n4, n3, n2, n1, n0); DROPn(5)) \ + YV(oled, OledRectF, oled_display->fillRect(n4, n3, n2, n1, n0); DROPn(5)) \ + YV(oled, OledRectR, oled_display->drawRoundRect(n5, n4, n3, n2, n1, n0); DROPn(6)) \ + YV(oled, OledRectRF, oled_display->fillRoundRect(n5, n4, n3, n2, n1, n0); DROPn(6)) #include "gen/esp32_oled.h" diff --git a/web/dump_web_opcodes.c b/web/dump_web_opcodes.c index 05a3baa..ce6611d 100644 --- a/web/dump_web_opcodes.c +++ b/web/dump_web_opcodes.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { #undef Z } else if (argc == 2 && strcmp(argv[1], "dict") == 0) { #define V(name) \ - printf(" Create(\"" #name "-builtins\", %d);\n", BUILTIN_FORK, OP_DOCREATE); \ + printf(" Create(\"" #name "-builtins\", %d);\n", BUILTIN_FORK); \ printf(" COMMA(%d);\n", VOC_ ## name); VOCABULARY_LIST #undef V @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) { #define G_SYS 256 printf(" const g_sys = %d;\n", G_SYS); #define EMITSYS(name) \ - printf(" const g_sys_%s = %d;\n", #name, 256 + 4 * (((cell_t *) &g_sys->name) - (cell_t*) g_sys)); + printf(" const g_sys_%s = %d;\n", #name, 256 + 4 * (int) (((cell_t *) &g_sys->name) - (cell_t*) g_sys)); EMITSYS(heap); EMITSYS(current); EMITSYS(context);