LED matrix on/off added

This commit is contained in:
Verkehrsrot 2019-08-18 16:55:43 +02:00
parent a4419ab6f0
commit 381286331f

View File

@ -34,6 +34,12 @@ const FONT_CHAR_INFO *ActiveFontCharInfo = ActiveFontInfo->Descriptors;
void init_matrix_display(bool reverse) { void init_matrix_display(bool reverse) {
ESP_LOGI(TAG, "Initializing LED Matrix display"); ESP_LOGI(TAG, "Initializing LED Matrix display");
matrix.begin(displaybuf, LED_MATRIX_WIDTH, LED_MATRIX_HEIGHT); matrix.begin(displaybuf, LED_MATRIX_WIDTH, LED_MATRIX_HEIGHT);
if (MatrixDisplayIsOn)
matrix.on();
else
matrix.off();
if (reverse) if (reverse)
matrix.reverse(); matrix.reverse();
matrix.clear(); matrix.clear();
@ -52,6 +58,10 @@ void refreshTheMatrixDisplay(bool nextPage) {
// set display on/off according to current device configuration // set display on/off according to current device configuration
if (MatrixDisplayIsOn != cfg.screenon) { if (MatrixDisplayIsOn != cfg.screenon) {
MatrixDisplayIsOn = cfg.screenon; MatrixDisplayIsOn = cfg.screenon;
if (MatrixDisplayIsOn)
matrix.on();
else
matrix.off();
} }
if (nextPage) { if (nextPage) {