From 1fb7993d66844f692b5da07f2c4787cfb550d9b9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 2 Jan 2019 17:18:47 +0100 Subject: [PATCH] Fix epaper driver (#4785) Fix epaper driver (#4785) --- sonoff/_changelog.ino | 1 + sonoff/xdsp_05_epaper_29.ino | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index a79d21d35..0aa205aef 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,5 +1,6 @@ /* 6.4.1.4 20190101 * Update Copyright (C) 2019 + * Fix epaper driver (#4785) * * 6.4.1.3 20181229 * Change sonoff_template.h module lay-out by removing non-configurable GPIOs diff --git a/sonoff/xdsp_05_epaper_29.ino b/sonoff/xdsp_05_epaper_29.ino index 2a7daeb90..3904cb97f 100644 --- a/sonoff/xdsp_05_epaper_29.ino +++ b/sonoff/xdsp_05_epaper_29.ino @@ -19,7 +19,7 @@ #ifdef USE_SPI #ifdef USE_DISPLAY -#ifdef USE_DISPLAY_EPAPER +#ifdef USE_DISPLAY_EPAPER_29 #define XDSP_05 5 @@ -123,12 +123,16 @@ void EpdInitDriver(void) epd.sclk_pin = pin[GPIO_SPI_CLK]; // 14 epd.mosi_pin = pin[GPIO_SPI_MOSI]; // 13 EpdInitMode(); + snprintf_P(log_data, sizeof(log_data), PSTR("EPD: HardSPI CS %d, CLK %d, MOSI %d"), epd.cs_pin, epd.sclk_pin, epd.mosi_pin); + AddLog(LOG_LEVEL_DEBUG); } else if ((pin[GPIO_SSPI_CS] < 99) && (pin[GPIO_SSPI_SCLK] < 99) && (pin[GPIO_SSPI_MOSI] < 99)) { epd.cs_pin = pin[GPIO_SSPI_CS]; epd.sclk_pin = pin[GPIO_SSPI_SCLK]; epd.mosi_pin = pin[GPIO_SSPI_MOSI]; EpdInitMode(); + snprintf_P(log_data, sizeof(log_data), PSTR("EPD: SoftSPI CS %d, CLK %d, MOSI %d"), epd.cs_pin, epd.sclk_pin, epd.mosi_pin); + AddLog(LOG_LEVEL_DEBUG); } } } @@ -337,6 +341,6 @@ boolean Xdsp05(byte function) return result; } -#endif // USE_DISPLAY_EPAPER +#endif // USE_DISPLAY_EPAPER_29 #endif // USE_DISPLAY #endif // USE_SPI