sensor: bq274xx: fix sleep logic when polling after softreset

The bq274xx fuel gauge does a softreset when configuring, after
which the device is polled and sealed. However the sleep logic
was inverted so the poll became blocking.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2021-06-09 10:03:19 +02:00 committed by Carles Cufí
commit 46643dcb05

View file

@ -624,10 +624,10 @@ static int bq274xx_gauge_configure(const struct device *dev)
return -EIO; return -EIO;
} }
if (!(flags & 0x0010)) { if (flags & 0x0010) {
k_msleep(BQ274XX_SUBCLASS_DELAY * 10); k_msleep(BQ274XX_SUBCLASS_DELAY * 10);
} }
} while ((flags & 0x0010)); } while (flags & 0x0010);
/* Seal the gauge */ /* Seal the gauge */
status = bq274xx_control_reg_write(bq274xx, BQ274XX_CONTROL_SEALED); status = bq274xx_control_reg_write(bq274xx, BQ274XX_CONTROL_SEALED);