auto init display

This commit is contained in:
Siwat Sirichai 2024-03-30 22:41:21 +07:00
parent 9725a8d867
commit 84d20173ac
2 changed files with 11 additions and 0 deletions

View File

@ -929,3 +929,13 @@ void InternalDisplay::setBootStatus(const char *text)
this->sendStopBytes(); this->sendStopBytes();
this->giveSerialMutex(); this->giveSerialMutex();
} }
void InternalDisplay::handlePayload(uint8_t type, uint8_t *payload, uint8_t length) {
// If payload of type 0x92 is received
// Send the display to page 1
if (type == 0x92)
{
this->jumpToPage(1);
}
}

View File

@ -104,6 +104,7 @@ class InternalDisplay : public ESPMegaDisplay {
void handleInputStateChange(uint8_t pin, bool state); void handleInputStateChange(uint8_t pin, bool state);
void handlePwmStateChange(uint8_t pin, bool state, uint16_t value); void handlePwmStateChange(uint8_t pin, bool state, uint16_t value);
void handlePageChange(uint8_t page); void handlePageChange(uint8_t page);
void handlePayload(uint8_t type, uint8_t *payload, uint8_t length);
void setOutputBar(uint8_t pin, uint16_t value); void setOutputBar(uint8_t pin, uint16_t value);
void setOutputStateColor(uint8_t pin, bool state); void setOutputStateColor(uint8_t pin, bool state);
void setInputMarker(uint8_t pin, bool state); void setInputMarker(uint8_t pin, bool state);