From 59b6a10de874981ee87472c18211302c1cff0aed Mon Sep 17 00:00:00 2001 From: reaw Date: Fri, 16 Feb 2024 02:42:55 +0700 Subject: [PATCH] Last row no work --- platformio.ini | 2 +- src/ise_display.cpp | 24 ++++++------------------ src/ise_display_definitions.hpp | 16 ++++++++-------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/platformio.ini b/platformio.ini index 11ffeab..5c33311 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,6 +14,6 @@ board = wt32-eth01 framework = arduino lib_deps = siwats/ESPMegaPROR3@^2.3.5 monitor_speed = 115200 -build_flags = -DCORE_DEBUG_LEVEL=0 +build_flags = -DCORE_DEBUG_LEVEL=5 upload_port = COM28 monitor_port = COM28 \ No newline at end of file diff --git a/src/ise_display.cpp b/src/ise_display.cpp index 6ee33bb..646c329 100644 --- a/src/ise_display.cpp +++ b/src/ise_display.cpp @@ -275,33 +275,21 @@ void ISEDisplay::handlePWMChange(uint8_t pin, bool state, uint16_t value) uint8_t current_page = this->currentPage; if (current_page == PAGE_STANDBY) { - if (pin >= 1 && pin <= 4) + if ((pin >= 0 && pin <= 3) ||(pin >= 8 && pin <= 11)) { // Light updateLightGroupStatePageStandby(); // time_since_last_screen_update = millis(); // update time since last activity } - else if (pin == 5 || pin == 6) - { - // Air Purifier - updateAirPurifierStateStandby(); - // time_since_last_screen_update = millis(); // update time since last activity - } } else if (current_page == PAGE_DASHBOARD) { - if (pin >= 1 && pin <= 4) + if ((pin >= 0 && pin <= 3) ||(pin >= 8 && pin <= 11)) { // Light updateLightGroupStatePageDashboard(); // time_since_last_screen_update = millis(); // update time since last activity } - else if (pin == 5 || pin == 6) - { - // Air Purifier - updateAirPurifierState(); - // time_since_last_screen_update = millis(); // update time since last activity - } } else { @@ -589,8 +577,8 @@ void ISEDisplay::setLightLevel(uint8_t row, uint8_t level) break; } - this->outputCard->setValue(primary_pin, primary); - this->outputCard->setValue(secondary_pin, secondary); + this->outputCard->setState(primary_pin, primary); + this->outputCard->setState(secondary_pin, secondary); } u_int8_t ISEDisplay::getLightLevel(uint8_t row) @@ -600,8 +588,8 @@ u_int8_t ISEDisplay::getLightLevel(uint8_t row) //lightLevel = this->outputCard->getValue(row); uint8_t primary_pin = *(light_array + 2*(row - 1)); uint8_t secondary_pin = *(light_array + 2*(row - 1) + 1); - bool primary = this->outputCard->getValue(primary_pin); - bool secondary = this->outputCard->getValue(secondary_pin); + bool primary = this->outputCard->getState(primary_pin); + bool secondary = this->outputCard->getState(secondary_pin); if (primary && secondary) { lightLevel = 3; diff --git a/src/ise_display_definitions.hpp b/src/ise_display_definitions.hpp index aae6adb..6b45c45 100644 --- a/src/ise_display_definitions.hpp +++ b/src/ise_display_definitions.hpp @@ -22,14 +22,14 @@ change light assignment 8: row 4 column 2 */ -#define LIGHT_ROW1_COLUMN1 1 -#define LIGHT_ROW1_COLUMN2 2 -#define LIGHT_ROW2_COLUMN1 3 -#define LIGHT_ROW2_COLUMN2 4 -#define LIGHT_ROW3_COLUMN1 5 -#define LIGHT_ROW3_COLUMN2 6 -#define LIGHT_ROW4_COLUMN1 7 -#define LIGHT_ROW4_COLUMN2 8 +#define LIGHT_ROW1_COLUMN1 0 +#define LIGHT_ROW1_COLUMN2 1 +#define LIGHT_ROW2_COLUMN1 2 +#define LIGHT_ROW2_COLUMN2 3 +#define LIGHT_ROW3_COLUMN1 8 +#define LIGHT_ROW3_COLUMN2 9 +#define LIGHT_ROW4_COLUMN1 10 +#define LIGHT_ROW4_COLUMN2 11 /* 5: Air Purifier status (on/off)