From 2cd272dd1cf3912b70ea2cc9f1b7b428fd479e81 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 10 Feb 2026 03:12:18 +0000 Subject: Removes abs correction on INA226 readings --- hsm-ina226/Hsm/INA226.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hsm-ina226') diff --git a/hsm-ina226/Hsm/INA226.hs b/hsm-ina226/Hsm/INA226.hs index ed9cc23..12beed0 100644 --- a/hsm-ina226/Hsm/INA226.hs +++ b/hsm-ina226/Hsm/INA226.hs @@ -98,9 +98,9 @@ busVoltageLSB = 0.00125 readINA226State :: (I2CINA226 :> es, INA226 :> es, Logs '["i2c", "ina226"] es) => Eff es INA226Reading readINA226State = do logMsg @"ina226" Trace "Reading INA226 state registers" - voltage <- (* busVoltageLSB) . abs . fromIntegral <$> readWord16 busVoltageReg - current <- (* currentLSB) . abs . fromIntegral <$> readInt16 currentReg - power <- (* powerLSB) . abs . fromIntegral <$> readInt16 powerReg + voltage <- (* busVoltageLSB) . fromIntegral <$> readWord16 busVoltageReg + current <- (* currentLSB) . fromIntegral <$> readInt16 currentReg + power <- (* powerLSB) . fromIntegral <$> readInt16 powerReg return INA226Reading{..} runINA226 :: (I2CINA226 :> es, IOE :> es, Logs '["i2c", "ina226"] es) => Eff (INA226 : es) a -> Eff es a -- cgit v1.2.3-70-g09d2