fix display update when using different baudrate
This commit is contained in:
parent
84d20173ac
commit
e2977c565c
|
@ -638,7 +638,7 @@ bool ESPMegaDisplay::beginUpdate(size_t size)
|
||||||
{
|
{
|
||||||
// The display's baudrate might be stuck at 9600 if the display is not initialized
|
// The display's baudrate might be stuck at 9600 if the display is not initialized
|
||||||
// We try to initiate the display at the user specified baud rate first, if it fails, we try again at 9600
|
// We try to initiate the display at the user specified baud rate first, if it fails, we try again at 9600
|
||||||
if (!beginUpdate(size, uploadBaudRate))
|
if (!beginUpdate(size, baudRate))
|
||||||
{
|
{
|
||||||
ESP_LOGW("ESPMegaDisplay", "Failed to initiate LCD update at %d baud, retrying at 9600 baud.", uploadBaudRate);
|
ESP_LOGW("ESPMegaDisplay", "Failed to initiate LCD update at %d baud, retrying at 9600 baud.", uploadBaudRate);
|
||||||
if (!beginUpdate(size, 9600))
|
if (!beginUpdate(size, 9600))
|
||||||
|
|
|
@ -17,6 +17,8 @@ void InternalDisplay::begin(ESPMegaIoT *iot, std::function<rtctime_t()> getRtcTi
|
||||||
// Register callbacks
|
// Register callbacks
|
||||||
auto bindedPageChangeCallback = std::bind(&InternalDisplay::handlePageChange, this, std::placeholders::_1);
|
auto bindedPageChangeCallback = std::bind(&InternalDisplay::handlePageChange, this, std::placeholders::_1);
|
||||||
this->registerPageChangeCallback(bindedPageChangeCallback);
|
this->registerPageChangeCallback(bindedPageChangeCallback);
|
||||||
|
auto bindedPayloadCallback = std::bind(&InternalDisplay::handlePayload, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
||||||
|
this->registerPayloadCallback(bindedPayloadCallback);
|
||||||
auto bindedTouchCallback = std::bind(&InternalDisplay::handleTouch, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
auto bindedTouchCallback = std::bind(&InternalDisplay::handleTouch, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
||||||
this->registerTouchCallback(bindedTouchCallback);
|
this->registerTouchCallback(bindedTouchCallback);
|
||||||
// Initialize the display
|
// Initialize the display
|
||||||
|
|
Loading…
Reference in New Issue