We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6bb80d commit aa21ee3Copy full SHA for aa21ee3
1 file changed
src/main.cpp
@@ -420,10 +420,11 @@ vTaskAdjustLoad([[maybe_unused]] void *pvParameters) { // NOSONAR
420
// i += 20;
421
static int_fast32_t lastPower = INT_FAST32_MIN;
422
static int_fast8_t powerIndex = 46;
423
- if (INA260::current_mA > 0) {
+ // if (INA260::current_mA > 0) {
424
+ if (loadFSM.getCurrentState() != FSMCommon::States::sRunLoad) {
425
// Don't run at startup
426
delay(RUN::TASK_INTERVALS::TI_ADJUST_LOAD_mS);
- } else if (abs(INA260::dPower_mWPS) > (abs(INA260::power_mW) * 0.05)) {
427
+ } else if (abs(INA260::dPower_mWPS) < (abs(INA260::power_mW) * 0.05)) {
428
// Wait for power to stabilize
429
} else if ((lastPower == INT_FAST32_MIN) && (powerIndex > 0)) {
430
powerIndex--;
0 commit comments