Skip to content

Commit

Permalink
Fix epaper driver (arendst#4785)
Browse files Browse the repository at this point in the history
Fix epaper driver (arendst#4785)
  • Loading branch information
arendst committed Jan 2, 2019
1 parent b8c7cc6 commit 617f3e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions sonoff/xdsp_05_epaper_29.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifdef USE_SPI
#ifdef USE_DISPLAY
#ifdef USE_DISPLAY_EPAPER
#ifdef USE_DISPLAY_EPAPER_29

#define XDSP_05 5

Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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

0 comments on commit 617f3e4

Please sign in to comment.