initial support for pi pico

This commit is contained in:
steve 2024-10-12 14:40:22 +01:00
parent 0d40d7008b
commit de511a2346
16 changed files with 49 additions and 38 deletions

View File

@ -54,7 +54,10 @@ void reset() {
dsp.status("Reset failed"); dsp.status("Reset failed");
return; return;
} }
io.start(); if (!io.start()) {
dsp.status("IO Start failed");
return;
}
#if defined(KRUSADER) #if defined(KRUSADER)
dsp.status("Krusader: F000R / Basic: E000R"); dsp.status("Krusader: F000R / Basic: E000R");
#else #else
@ -62,6 +65,15 @@ void reset() {
#endif #endif
} }
static const char *open(const char *filename) {
if (filename) {
dsp.status(filename);
return filename;
}
dsp.status("No file");
return 0;
}
void function_key(uint8_t fn) { void function_key(uint8_t fn) {
static const char *filename; static const char *filename;
@ -70,20 +82,18 @@ void function_key(uint8_t fn) {
reset(); reset();
break; break;
case 2: case 2:
filename = io.files.advance(); filename = open(io.files.advance());
dsp.status(filename);
break; break;
case 3: case 3:
filename = io.files.rewind(); filename = open(io.files.rewind());
dsp.status(filename);
break; break;
case 4: case 5:
io.load(); io.load();
break; break;
case 6: case 7:
dsp.status(io.files.checkpoint()); dsp.status(io.files.checkpoint());
break; break;
case 7: case 8:
if (filename) if (filename)
io.files.restore(filename); io.files.restore(filename);
break; break;
@ -94,27 +104,24 @@ void function_key(uint8_t fn) {
} }
void setup() { void setup() {
#if defined(DEBUGGING) || defined(CPU_DEBUG)
Serial.begin(TERMINAL_SPEED);
Serial.println();
Serial.print("RAM: ");
Serial.print(RAM_PAGES);
Serial.print("kB at 0x0000");
Serial.println();
#if defined(USE_SPIRAM)
Serial.print("SpiRAM: ");
Serial.print(SPIRAM_EXTENT * Memory::page_size / 1024);
Serial.print("kB at 0x");
Serial.print(SPIRAM_BASE, 16);
Serial.println();
#endif
#endif
hardware_init(cpu); hardware_init(cpu);
DBG(print("RAM: "));
DBG(print(RAM_PAGES));
DBG(print("kB at 0x0000"));
DBG(println());
for (unsigned i = 0; i < RAM_PAGES; i++) for (unsigned i = 0; i < RAM_PAGES; i++)
memory.put(pages[i], i * ram<>::page_size); memory.put(pages[i], i * ram<>::page_size);
#if defined(USE_SPIRAM) #if defined(USE_SPIRAM)
DBG(print("SpiRAM: "));
DBG(print(SPIRAM_EXTENT * Memory::page_size / 1024));
DBG(print("kB at 0x"));
DBG(print(SPIRAM_BASE, 16));
DBG(println());
memory.put(sram, SPIRAM_BASE, SPIRAM_EXTENT); memory.put(sram, SPIRAM_BASE, SPIRAM_EXTENT);
#endif #endif

View File

@ -1,31 +1,28 @@
t ?= esp32 t ?= esp32
TERMINAL_SPEED := 115200 TERMINAL_SPEED := 115200
#CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD -DPS2_SERIAL_KBD=\"UK\" CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD
CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD -DUSE_SERIAL
LIBRARIES = PS2KeyAdvanced PS2KeyMap LIBRARIES = PS2KeyAdvanced PS2KeyMap
ifeq ($t, esp8266) ifeq ($t, esp8266)
BOARD := d1_mini BOARD := d1_mini
BAUD := 921600 BAUD := 921600
FS_DIR := programs
EESZ := 4M1M EESZ := 4M1M
F_CPU := 80 F_CPU := 80
CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=PIN_D8 -DTFT_DC=PIN_D1 \ CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=PIN_D8 -DTFT_DC=PIN_D1 \
-DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \ -DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \
-DHARDWARE_H=\"hw/esp8bit.h\" -DHARDWARE_H=\"hw/esp8bit.h\" -DPS2_SERIAL_KBD=\"UK\"
LIBRARIES += TFT_eSPI SpiRAM LittleFS LIBRARIES += TFT_eSPI SpiRAM LittleFS
endif endif
ifeq ($t, tivac) ifeq ($t, tivac)
BOARD := EK-LM4F120XL BOARD := EK-LM4F120XL
CPPFLAGS += -DHARDWARE_H=\"hw/stellarpad-example.h\" CPPFLAGS += -DHARDWARE_H=\"hw/stellarpad-example.h\" -DPS2_SERIAL_KBD=\"UK\"
LIBRARIES += UTFT SD SpiRAM LIBRARIES += UTFT SD SpiRAM
endif endif
ifeq ($t, esp32) ifeq ($t, esp32)
UPLOADSPEED := 921600 UPLOADSPEED := 921600
FS_DIR := programs
LIBRARIES += FS SPIFFS LIBRARIES += FS SPIFFS
ifeq ($b, lilygo) ifeq ($b, lilygo)
@ -38,9 +35,16 @@ else
BOARD := lolin32 BOARD := lolin32
CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=5 -DTFT_DC=2 \ CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=5 -DTFT_DC=2 \
-DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \ -DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \
-DHARDWARE_H=\"hw/esp32-example.h\" -DHARDWARE_H=\"hw/esp32-example.h\" -DUSE_SERIAL
LIBRARIES += TFT_eSPI LIBRARIES += TFT_eSPI
endif endif
endif endif
ifeq ($t, rp2040)
BOARD := adafruit_feather_dvi
FLASH := 8388608_2097152
CPPFLAGS += -DHARDWARE_H=\"hw/adafruit_feather_dvi.h\" -DPS2_SERIAL_KBD=\"UK\"
LIBRARIES += LittleFS PicoDVI Adafruit_GFX Adafruit_BusIO Wire
endif
include $t.mk include $t.mk

View File

@ -13,10 +13,10 @@ Requirements
Keyboard Keyboard
-------- --------
- F1 (^N): reset - F1 (^N): reset
- F2 (^M): advance tape - F2 (^O): advance tape
- F3 (^O): rewind tape - F3 (^P): rewind tape
- F4 (^P): load program from tape (by simulating typing it) - F5 (^R): load program from tape (by simulating typing it)
- F6 (^R): checkpoint machine - F7 (^T): checkpoint machine
- F7 (^S): restore from current checkpoint on tape - F8 (^U): restore from current checkpoint on tape
- F10(^W): watch CPU execute instructions - F10(^W): watch CPU execute instructions
- Underscore is rubout - Underscore is rubout

View File

@ -16,9 +16,9 @@
#endif #endif
// uncomment to use TFT / VGA display // uncomment to use TFT / VGA / DVI display
// otherwise serial terminal is used // otherwise serial terminal is used
//#define SCREEN_SERIAL_DSP #define SCREEN_SERIAL_DSP
#define FG_COLOUR GREEN #define FG_COLOUR GREEN
#define BG_COLOUR BLACK #define BG_COLOUR BLACK