puno counter

This commit is contained in:
2026-08-13 17:54:42 +02:00
parent ddb9ea7173
commit 2d3c115703

View File

@@ -233,17 +233,16 @@ void aio_update(struct aio_t *aio) {
SET_FANS_DUTY(aio->handle, (uint8_t)fan_duty);
/* pump logic */
static int16_t counter = 0;
if (fan_duty > (float)params.fans.max_duty * 0.75f && counter < 300)
counter++;
if (fan_duty < (float)params.fans.min_duty * 1.33f && counter > 0)
counter--;
if (fan_duty > (float)params.fans.max_duty * 0.75f && aio->pump_counter < 300)
aio->pump_counter++;
if (fan_duty < (float)params.fans.min_duty * 1.75f && aio->pump_counter > 0)
aio->pump_counter--;
if (counter > 280)
if (aio->pump_counter > 280)
aio_set_pump_mode(aio->handle, EXTREME);
if (counter > 60)
if (aio->pump_counter > 60)
aio_set_pump_mode(aio->handle, BALANCED);
if (counter == 0)
if (aio->pump_counter == 0)
aio_set_pump_mode(aio->handle, QUIET);
// applog(LOG_DBG, "aio->pump_counter is %d", aio->pump_counter);