diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-02-10 03:12:18 +0000 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-02-10 03:12:18 +0000 |
| commit | 2cd272dd1cf3912b70ea2cc9f1b7b428fd479e81 (patch) | |
| tree | 0ae320aa4047133f899dd87ff4073cd3c2f19ccb | |
| parent | 39c4a5f7ad2a7cffe5227d20ed7485845911c905 (diff) | |
Removes abs correction on INA226 readings
| -rw-r--r-- | hsm-ina226/Hsm/INA226.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
