From 0700d2c1b845cdc894e73829774a1384f290613f Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 25 Jul 2023 16:51:34 +0100 Subject: [PATCH] changes for LilyGO --- Makefile | 20 +++++++++++++++----- config.h | 10 ++++++---- io.cpp | 4 ++-- io.h | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 7f33847..44fbfb1 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,24 @@ LIBRARIES := UTFT SD SpiRAM endif ifeq ($t, esp32) -BOARD := node32s UPLOAD_SPEED := 921600 FS_DIR := programs -CPPFLAGS = -DDEBUGGING -DCPU_DEBUG \ - -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=5 -DTFT_DC=2 \ +CPPFLAGS = -DDEBUGGING -DCPU_DEBUG -DTERMINAL_SPEED=$(TERMINAL_SPEED) +LIBRARIES = FS SPIFFS + +ifeq ($b, lilygo) +BOARD := ttgo-t7-v14-mini32 +SERIAL_PORT := /dev/ttyACM0 +CPPFLAGS += -DHARDWARE_H=\"hw/lilygo-vga32.h\" +LIBRARIES += FabGL WiFi + +else +BOARD := node32s +CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=5 -DTFT_DC=2 \ -DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \ - -DHARDWARE_H=\"hw/esp32-espi.h\" -DTERMINAL_SPEED=$(TERMINAL_SPEED) -LIBRARIES = TFT_eSPI FS SPIFFS + -DHARDWARE_H=\"hw/esp32-espi.h\" +LIBRARIES += TFT_eSPI +endif endif include $t.mk diff --git a/config.h b/config.h index c66f632..d388efd 100644 --- a/config.h +++ b/config.h @@ -18,13 +18,15 @@ #define CPU_INSTRUCTIONS 1000 -#define TFT_FG GREEN -#define TFT_BG BLACK +#define FG_COLOUR GREEN +#define BG_COLOUR BLACK #if defined(USE_UTFT) -#define TFT_ORIENT landscape +#define ORIENT landscape #elif defined(USE_ESPI) -#define TFT_ORIENT reverse_landscape +#define ORIENT reverse_landscape +#elif defined(USE_VGA) +#define ORIENT landscape #endif #if defined(USE_SD) diff --git a/io.cpp b/io.cpp index 2bcf9bd..16b9a48 100644 --- a/io.cpp +++ b/io.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -18,7 +18,7 @@ static unsigned r, c; static char screen[ROWS][COLS]; void io::reset() { - TFTDisplay::begin(TFT_BG, TFT_FG, TFT_ORIENT); + Display::begin(BG_COLOUR, FG_COLOUR, ORIENT); clear(); _cy += 2; diff --git a/io.h b/io.h index bfe73a3..9d19df9 100644 --- a/io.h +++ b/io.h @@ -2,7 +2,7 @@ #define _IO_H // http://mamedev.org/source/src/mess/machine/apple1.c.html -class io: public TFTDisplay, Keyboard, public pia { +class io: public Display, Keyboard, public pia { public: io(filer &files): files(files) {}