From d6dfbe06ef4ad84f6b1967a0f930cec48c89d2de Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Sun, 11 Nov 2018 11:59:43 +0000 Subject: [PATCH] fixes for lm4f --- hw/lm4f-utft-sd.h | 1 + sdtape.cpp | 2 +- sound_pwm.cpp | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/lm4f-utft-sd.h b/hw/lm4f-utft-sd.h index c8f4cc5..feee865 100644 --- a/hw/lm4f-utft-sd.h +++ b/hw/lm4f-utft-sd.h @@ -1,6 +1,7 @@ // TFT display... // NOTE: edit memorysaver.h to select the correct chip for your display! // Daniel Rebollo's boosterpack +#define USE_UTFT #define TFT_BACKLIGHT PD_6 #define TFT_MODEL SSD1289 #define TFT_RS PC_6 diff --git a/sdtape.cpp b/sdtape.cpp index f129b59..59129a7 100644 --- a/sdtape.cpp +++ b/sdtape.cpp @@ -25,7 +25,7 @@ bool sdtape::start(const char *programs) #if defined(ESP8266) SPIFFS.begin(); dir = SPIFFS.openDir("/"); -#else if defined(DISK) +#elif defined(DISK) dir = DISK.open(programs); if (!dir) return false; diff --git a/sound_pwm.cpp b/sound_pwm.cpp index d4905a6..471e099 100644 --- a/sound_pwm.cpp +++ b/sound_pwm.cpp @@ -40,7 +40,7 @@ void PWM::set_freq(unsigned freq) { ESP_ERROR_CHECK(::ledc_set_freq(SPEED_MODE, TIMER, freq)); } -#else +#elif defined(PWM_SOUND) static unsigned pin; void PWM::begin(unsigned gpio) { @@ -59,4 +59,18 @@ void PWM::stop() { void PWM::set_freq(unsigned freq) { analogWriteFreq(freq); } + +#else + +void PWM::begin(unsigned gpio) { +} + +void PWM::set_duty(unsigned duty) { +} + +void PWM::stop() { +} + +void PWM::set_freq(unsigned freq) { +} #endif