Skip to content

Commit a3267ec

Browse files
Fixed incorrect load adjustment condition
Co-Authored-By: arloeitreim <105323402+arloeitreim@users.noreply.github.com>
1 parent eb3923f commit a3267ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,12 @@ vTaskAdjustLoad([[maybe_unused]] void *pvParameters) { // NOSONAR
439439
load.setLoadGPIO(LOAD::RES_INDEX_TABLE[powerIndex]);
440440
ESP_LOGI(TAG, "Initial load adjustment, setpoint: %d",
441441
LOAD::RES_INDEX_TABLE[powerIndex]);
442-
} else if ((INA260::dPower_mWPS > lastPower) && (powerIndex > 0)) {
442+
} else if ((INA260::power_mW > lastPower) && (powerIndex > 0)) {
443443
powerIndex--;
444444
load.setLoadGPIO(LOAD::RES_INDEX_TABLE[powerIndex]);
445445
ESP_LOGI(TAG, "Decreasing load to %d",
446446
LOAD::RES_INDEX_TABLE[powerIndex]);
447-
} else if ((INA260::dPower_mWPS < lastPower) && (powerIndex < 46)) {
447+
} else if ((INA260::power_mW < lastPower) && (powerIndex < 46)) {
448448
powerIndex++;
449449
load.setLoadGPIO(LOAD::RES_INDEX_TABLE[powerIndex]);
450450
ESP_LOGI(TAG, "Increasing load to %d",

0 commit comments

Comments
 (0)