From 381286331f628621f60a41f0dfe6860922f18c2e Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sun, 18 Aug 2019 16:55:43 +0200 Subject: [PATCH] LED matrix on/off added --- src/ledmatrixdisplay.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ledmatrixdisplay.cpp b/src/ledmatrixdisplay.cpp index b9af6ec5..6c22fd23 100644 --- a/src/ledmatrixdisplay.cpp +++ b/src/ledmatrixdisplay.cpp @@ -34,6 +34,12 @@ const FONT_CHAR_INFO *ActiveFontCharInfo = ActiveFontInfo->Descriptors; void init_matrix_display(bool reverse) { ESP_LOGI(TAG, "Initializing LED Matrix display"); matrix.begin(displaybuf, LED_MATRIX_WIDTH, LED_MATRIX_HEIGHT); + + if (MatrixDisplayIsOn) + matrix.on(); + else + matrix.off(); + if (reverse) matrix.reverse(); matrix.clear(); @@ -52,6 +58,10 @@ void refreshTheMatrixDisplay(bool nextPage) { // set display on/off according to current device configuration if (MatrixDisplayIsOn != cfg.screenon) { MatrixDisplayIsOn = cfg.screenon; + if (MatrixDisplayIsOn) + matrix.on(); + else + matrix.off(); } if (nextPage) {