Skip to content

Commit

Permalink
0.8.132
Browse files Browse the repository at this point in the history
* improved refresh routine of ePeper
* added default pin seetings for opendtufusion board
  • Loading branch information
lumapu committed Aug 9, 2024
1 parent 77ac64d commit c64f028
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
2 changes: 2 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 0.8.132 - 2024-08-09
* 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
* improved refresh routine of ePaper, full refresh each 12h #1107 #1706
Expand Down
42 changes: 22 additions & 20 deletions src/plugins/Display/Display_ePaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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->setRotation(mDisplayRotation);
_display->setFullWindow();
_display->setTextColor(GxEPD_BLACK);
_display->firstPage();
_version = version;
}
}
Expand All @@ -66,44 +68,42 @@ void DisplayEPaper::fullRefresh() {
void DisplayEPaper::refreshLoop() {
switch(mRefreshState) {
case RefreshStatus::LOGO:
_display->fillScreen(GxEPD_BLACK);
_display->firstPage();
_display->drawBitmap(0, 0, logo, 200, 200, GxEPD_WHITE);
mSecondCnt = 4;
mNextRefreshState = RefreshStatus::LOGO_WAIT;
mRefreshState = RefreshStatus::WAIT;
_display->fillScreen(GxEPD_WHITE);
_display->drawInvertedBitmap(0, 0, logo, 200, 200, GxEPD_BLACK);
if(_display->nextPage())
break;
mSecondCnt = 10;
_display->powerOff();
mRefreshState = RefreshStatus::LOGO_WAIT;
break;

case RefreshStatus::LOGO_WAIT:
if(0 != mSecondCnt)
break;
mRefreshState = RefreshStatus::BLACK;
mRefreshState = RefreshStatus::WHITE;
_display->firstPage();
break;

case RefreshStatus::BLACK:
_display->fillScreen(GxEPD_BLACK);
if(_display->nextPage())
break;
mRefreshState = RefreshStatus::WHITE;
_display->firstPage();
mNextRefreshState = RefreshStatus::WHITE;
mRefreshState = RefreshStatus::WAIT;
break;

case RefreshStatus::WHITE:
_display->fillScreen(GxEPD_WHITE);
if(_display->nextPage())
break;
mRefreshState = RefreshStatus::PARTITIALS;
_display->firstPage();
mNextRefreshState = RefreshStatus::PARTITIALS;
mRefreshState = RefreshStatus::WAIT;
break;

case RefreshStatus::WAIT:
if(!_display->nextPage())
mRefreshState = mNextRefreshState;
break;

case RefreshStatus::PARTITIALS:
headlineIP();
versionFooter();
mNextRefreshState = RefreshStatus::DONE;
mRefreshState = RefreshStatus::WAIT;
mRefreshState = RefreshStatus::DONE;
break;

default: // RefreshStatus::DONE
Expand Down Expand Up @@ -315,7 +315,9 @@ void DisplayEPaper::loop(float totalPower, float totalYieldDay, float totalYield

//***************************************************************************
void DisplayEPaper::tickerSecond() {
if(mSecondCnt > 0)
mSecondCnt--;
if(RefreshStatus::LOGO_WAIT == mRefreshState) {
if(mSecondCnt > 0)
mSecondCnt--;
}
}
#endif // ESP32
4 changes: 2 additions & 2 deletions src/plugins/Display/Display_ePaper.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class DisplayEPaper {
DONE,
BLACK,
WHITE,
WAIT,
PARTITIALS,
LOGO,
LOGO_WAIT
Expand All @@ -63,7 +62,8 @@ class DisplayEPaper {
uint32_t* mUtcTs;
bool mEnPowerSave;
const char* _version;
RefreshStatus mRefreshState, mNextRefreshState;
RefreshStatus mRefreshState;

uint8_t mSecondCnt;
bool mLogoDisplayed;
#if defined(SPI_HAL)
Expand Down
36 changes: 18 additions & 18 deletions src/web/html/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@
[6, "GPIO6"],
[7, "GPIO7"],
[8, "GPIO8"],
[9, "GPIO9"],
[10, "GPIO10"],
[11, "GPIO11"],
[12, "GPIO12"],
[13, "GPIO13"],
[14, "GPIO14"],
[9, "GPIO9 (DATA display)"],
[10, "GPIO10 (SCK display)"],
[11, "GPIO11 (CS display)"],
[12, "GPIO12 (DC display)"],
[13, "GPIO13 (RST display)"],
[14, "GPIO14 (BUSY display)"],
[15, "GPIO15"],
[16, "GPIO16"],
[17, "GPIO17"],
Expand All @@ -487,20 +487,20 @@
[32, "GPIO32 (FLASH - {#PIN_NOT_AVAIL})"],
[33, "GPIO33 (not exposed on S3-WROOM modules)"],
[34, "GPIO34 (not exposed on S3-WROOM modules)"],
[35, "GPIO35"],
[36, "GPIO36"],
[37, "GPIO37"],
[38, "GPIO38"],
[39, "GPIO39"],
[40, "GPIO40"],
[41, "GPIO41"],
[42, "GPIO42"],
[43, "GPIO43"],
[44, "GPIO44"],
[35, "GPIO35 (MOSI NRF24)"],
[36, "GPIO36 (SCK NRF24)"],
[37, "GPIO37 (CSN NRF24)"],
[38, "GPIO38 (CE NRF24)"],
[39, "GPIO39 (SCK ETH)"],
[40, "GPIO40 (MOSI ETH)"],
[41, "GPIO41 (MISO ETH)"],
[42, "GPIO42 (CS ETH)"],
[43, "GPIO43 (RST ETH)"],
[44, "GPIO44 (INT ETH)"],
[45, "GPIO45 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[46, "GPIO46 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[47, "GPIO47"],
[48, "GPIO48"],
[47, "GPIO47 (IRQ NRF24)"],
[48, "GPIO48 (MISO NRF24)"],
];
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
Expand Down

0 comments on commit c64f028

Please sign in to comment.