From d22a61368e73ea6725d71258db4c54767b4b8a88 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 29 Nov 2018 18:11:29 +0000 Subject: [PATCH] esp8266 SD --- hardware.cpp | 14 +++++++------- hw/esp8266-pwm-sd.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 hw/esp8266-pwm-sd.h diff --git a/hardware.cpp b/hardware.cpp index 83e283c..56b2e06 100644 --- a/hardware.cpp +++ b/hardware.cpp @@ -4,13 +4,9 @@ #if defined(USE_SD) #include -#endif - -#if defined(USE_SPIFFS) +#elif defined(USE_SPIFFS) #include -#endif - -#if defined(ESP8266) +#elif defined(USE_FS) #include #endif @@ -41,13 +37,17 @@ bool hardware_reset() { #endif #if defined(USE_SD) +#if defined(SD_SPI) success = SD.begin(SD_CS, 2, SD_SPI); pinMode(SPI_CS, OUTPUT); // without this, the SPI-RAM isn't seen +#else + success = SD.begin(SD_CS); +#endif #elif defined(USE_SPIFFS) success = SPIFFS.begin(true); -#elif defined(ESP8266) +#elif defined(USE_FS) success = SPIFFS.begin(); #endif diff --git a/hw/esp8266-pwm-sd.h b/hw/esp8266-pwm-sd.h new file mode 100644 index 0000000..b1428c0 --- /dev/null +++ b/hw/esp8266-pwm-sd.h @@ -0,0 +1,30 @@ +// TFT display... +#define USE_ESPI +//must define these in Makefile (or platformio) +//#define USER_SETUP_LOADED +//#define ILI9341_DRIVER +//#define TFT_CS PIN_D6 +//#define TFT_DC PIN_D8 +//#define TFT_WIDTH 240 +//#define TFT_HEIGHT 320 +//#define TFT_RST -1 +//#define SPI_FREQUENCY 40000000 +//#define LOAD_GLCD + +// PS/2 keyboard +#define KBD_DATA D3 +#define KBD_IRQ D4 + +// SPI-RAM +#undef USE_SPIRAM + +// "tape" storage... +#define USE_SD +#define SD_CS D0 +#undef USE_SPIFFS +#undef USE_FS + +// sound +#define PWM_SOUND D2 +#define PWM_DUTY 20 // 20/1024 -> volume +#define PWM_TOP 1024