aboutsummaryrefslogtreecommitdiff
path: root/hsm-ina226
diff options
context:
space:
mode:
Diffstat (limited to 'hsm-ina226')
-rw-r--r--hsm-ina226/Test/INA226.hs5
-rw-r--r--hsm-ina226/hsm-ina226.cabal1
2 files changed, 4 insertions, 2 deletions
diff --git a/hsm-ina226/Test/INA226.hs b/hsm-ina226/Test/INA226.hs
index 71f8f45..a92fec7 100644
--- a/hsm-ina226/Test/INA226.hs
+++ b/hsm-ina226/Test/INA226.hs
@@ -1,9 +1,9 @@
{-# LANGUAGE TemplateHaskell #-}
-import Control.Concurrent (threadDelay)
import Control.Monad (forever)
import Data.Function ((&))
import Effectful (liftIO, runEff)
+import Effectful.Concurrent (runConcurrent, threadDelay)
import Hsm.Core.App (bootstrapApp)
import Hsm.I2C (runI2C)
import Hsm.INA226 (readINA226State, runINA226)
@@ -20,8 +20,9 @@ $(makeLoggerOptionParser @Logs "Options" "parser" 'Info)
main :: IO ()
main =
bootstrapApp parser "Launch INA226 Monitoring Test Application" $ \opts ->
- forever (liftIO (threadDelay 1000000) >> readINA226State >>= logMsg @"ina226" Info . show)
+ forever (threadDelay 1000000 >> readINA226State >>= logMsg @"ina226" Info . show)
& runINA226
& runI2C
& runLogsOpt @Options @Logs opts
+ & runConcurrent
& runEff
diff --git a/hsm-ina226/hsm-ina226.cabal b/hsm-ina226/hsm-ina226.cabal
index 6ac642a..ce831d1 100644
--- a/hsm-ina226/hsm-ina226.cabal
+++ b/hsm-ina226/hsm-ina226.cabal
@@ -23,6 +23,7 @@ executable test-ina226
build-depends:
, aeson
, base
+ , effectful
, effectful-core
, effectful-plugin
, hsm-core