Browse Source

0.8.132

* improved refresh routine of ePeper
* added default pin seetings for opendtufusion board
main
lumapu 6 months ago
parent
commit
c64f028ec1
  1. 2
      src/CHANGES.md
  2. 38
      src/plugins/Display/Display_ePaper.cpp
  3. 4
      src/plugins/Display/Display_ePaper.h
  4. 36
      src/web/html/setup.html

2
src/CHANGES.md

@ -2,6 +2,8 @@
## 0.8.132 - 2024-08-09 ## 0.8.132 - 2024-08-09
* fix boot loop once no ePaper is connected #1713, #1714 * fix boot loop once no ePaper is connected #1713, #1714
* improved refresh routine of ePeper
* added default pin seetings for opendtufusion board
## 0.8.131 - 2024-08-08 ## 0.8.131 - 2024-08-08
* improved refresh routine of ePaper, full refresh each 12h #1107 #1706 * improved refresh routine of ePaper, full refresh each 12h #1107 #1706

38
src/plugins/Display/Display_ePaper.cpp

@ -44,6 +44,8 @@ void DisplayEPaper::init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, u
_display->init(0, true, 20, false); _display->init(0, true, 20, false);
_display->setRotation(mDisplayRotation); _display->setRotation(mDisplayRotation);
_display->setFullWindow(); _display->setFullWindow();
_display->setTextColor(GxEPD_BLACK);
_display->firstPage();
_version = version; _version = version;
} }
} }
@ -66,44 +68,42 @@ void DisplayEPaper::fullRefresh() {
void DisplayEPaper::refreshLoop() { void DisplayEPaper::refreshLoop() {
switch(mRefreshState) { switch(mRefreshState) {
case RefreshStatus::LOGO: case RefreshStatus::LOGO:
_display->fillScreen(GxEPD_BLACK); _display->fillScreen(GxEPD_WHITE);
_display->firstPage(); _display->drawInvertedBitmap(0, 0, logo, 200, 200, GxEPD_BLACK);
_display->drawBitmap(0, 0, logo, 200, 200, GxEPD_WHITE); if(_display->nextPage())
mSecondCnt = 4; break;
mNextRefreshState = RefreshStatus::LOGO_WAIT; mSecondCnt = 10;
mRefreshState = RefreshStatus::WAIT; _display->powerOff();
mRefreshState = RefreshStatus::LOGO_WAIT;
break; break;
case RefreshStatus::LOGO_WAIT: case RefreshStatus::LOGO_WAIT:
if(0 != mSecondCnt) if(0 != mSecondCnt)
break; break;
mRefreshState = RefreshStatus::BLACK; mRefreshState = RefreshStatus::WHITE;
_display->firstPage();
break; break;
case RefreshStatus::BLACK: case RefreshStatus::BLACK:
_display->fillScreen(GxEPD_BLACK); _display->fillScreen(GxEPD_BLACK);
if(_display->nextPage())
break;
mRefreshState = RefreshStatus::WHITE;
_display->firstPage(); _display->firstPage();
mNextRefreshState = RefreshStatus::WHITE;
mRefreshState = RefreshStatus::WAIT;
break; break;
case RefreshStatus::WHITE: case RefreshStatus::WHITE:
_display->fillScreen(GxEPD_WHITE); _display->fillScreen(GxEPD_WHITE);
_display->firstPage(); if(_display->nextPage())
mNextRefreshState = RefreshStatus::PARTITIALS;
mRefreshState = RefreshStatus::WAIT;
break; break;
mRefreshState = RefreshStatus::PARTITIALS;
case RefreshStatus::WAIT: _display->firstPage();
if(!_display->nextPage())
mRefreshState = mNextRefreshState;
break; break;
case RefreshStatus::PARTITIALS: case RefreshStatus::PARTITIALS:
headlineIP(); headlineIP();
versionFooter(); versionFooter();
mNextRefreshState = RefreshStatus::DONE; mRefreshState = RefreshStatus::DONE;
mRefreshState = RefreshStatus::WAIT;
break; break;
default: // RefreshStatus::DONE default: // RefreshStatus::DONE
@ -315,7 +315,9 @@ void DisplayEPaper::loop(float totalPower, float totalYieldDay, float totalYield
//*************************************************************************** //***************************************************************************
void DisplayEPaper::tickerSecond() { void DisplayEPaper::tickerSecond() {
if(RefreshStatus::LOGO_WAIT == mRefreshState) {
if(mSecondCnt > 0) if(mSecondCnt > 0)
mSecondCnt--; mSecondCnt--;
}
} }
#endif // ESP32 #endif // ESP32

4
src/plugins/Display/Display_ePaper.h

@ -48,7 +48,6 @@ class DisplayEPaper {
DONE, DONE,
BLACK, BLACK,
WHITE, WHITE,
WAIT,
PARTITIALS, PARTITIALS,
LOGO, LOGO,
LOGO_WAIT LOGO_WAIT
@ -63,7 +62,8 @@ class DisplayEPaper {
uint32_t* mUtcTs; uint32_t* mUtcTs;
bool mEnPowerSave; bool mEnPowerSave;
const char* _version; const char* _version;
RefreshStatus mRefreshState, mNextRefreshState; RefreshStatus mRefreshState;
uint8_t mSecondCnt; uint8_t mSecondCnt;
bool mLogoDisplayed; bool mLogoDisplayed;
#if defined(SPI_HAL) #if defined(SPI_HAL)

36
src/web/html/setup.html

@ -465,12 +465,12 @@
[6, "GPIO6"], [6, "GPIO6"],
[7, "GPIO7"], [7, "GPIO7"],
[8, "GPIO8"], [8, "GPIO8"],
[9, "GPIO9"], [9, "GPIO9 (DATA display)"],
[10, "GPIO10"], [10, "GPIO10 (SCK display)"],
[11, "GPIO11"], [11, "GPIO11 (CS display)"],
[12, "GPIO12"], [12, "GPIO12 (DC display)"],
[13, "GPIO13"], [13, "GPIO13 (RST display)"],
[14, "GPIO14"], [14, "GPIO14 (BUSY display)"],
[15, "GPIO15"], [15, "GPIO15"],
[16, "GPIO16"], [16, "GPIO16"],
[17, "GPIO17"], [17, "GPIO17"],
@ -487,20 +487,20 @@
[32, "GPIO32 (FLASH - {#PIN_NOT_AVAIL})"], [32, "GPIO32 (FLASH - {#PIN_NOT_AVAIL})"],
[33, "GPIO33 (not exposed on S3-WROOM modules)"], [33, "GPIO33 (not exposed on S3-WROOM modules)"],
[34, "GPIO34 (not exposed on S3-WROOM modules)"], [34, "GPIO34 (not exposed on S3-WROOM modules)"],
[35, "GPIO35"], [35, "GPIO35 (MOSI NRF24)"],
[36, "GPIO36"], [36, "GPIO36 (SCK NRF24)"],
[37, "GPIO37"], [37, "GPIO37 (CSN NRF24)"],
[38, "GPIO38"], [38, "GPIO38 (CE NRF24)"],
[39, "GPIO39"], [39, "GPIO39 (SCK ETH)"],
[40, "GPIO40"], [40, "GPIO40 (MOSI ETH)"],
[41, "GPIO41"], [41, "GPIO41 (MISO ETH)"],
[42, "GPIO42"], [42, "GPIO42 (CS ETH)"],
[43, "GPIO43"], [43, "GPIO43 (RST ETH)"],
[44, "GPIO44"], [44, "GPIO44 (INT ETH)"],
[45, "GPIO45 ({#PIN_DONT_USE} - STRAPPING PIN)"], [45, "GPIO45 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[46, "GPIO46 ({#PIN_DONT_USE} - STRAPPING PIN)"], [46, "GPIO46 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[47, "GPIO47"], [47, "GPIO47 (IRQ NRF24)"],
[48, "GPIO48"], [48, "GPIO48 (MISO NRF24)"],
]; ];
/*ENDIF_ESP32-S3*/ /*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/ /*IF_ESP32-C3*/

Loading…
Cancel
Save