aboutsummaryrefslogtreecommitdiff
path: root/hsm-cam/Test
diff options
context:
space:
mode:
Diffstat (limited to 'hsm-cam/Test')
-rw-r--r--hsm-cam/Test/Cam.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/hsm-cam/Test/Cam.hs b/hsm-cam/Test/Cam.hs
index 9b06785..fc56b6c 100644
--- a/hsm-cam/Test/Cam.hs
+++ b/hsm-cam/Test/Cam.hs
@@ -1,16 +1,11 @@
import Control.Monad (forM_)
import Data.ByteString.Lazy (writeFile)
-import Data.Function ((&))
import Effectful (liftIO, runEff)
import Hsm.Cam (capturePng, runCam)
-import Hsm.Log (Severity(Info, Trace), logMsg, runLog)
+import Hsm.Log (Severity(Info, Trace), runLog)
import Prelude hiding (writeFile)
main :: IO ()
-main = forM_ [0 .. 31] savePng & runCam & runLog @"cam" Trace & runEff
- where
- savePng index = do
- logMsg Info $ "Saving image to file: " <> path
- capturePng >>= liftIO . writeFile path
- where
- path = "/tmp/hsm-cam-test" <> show @Int index <> ".png"
+main =
+ runEff . runLog @"cam" Trace . runLog @"libcamera" Info . runCam . forM_ [0 .. 31] $ \index ->
+ capturePng >>= liftIO . writeFile ("/tmp/hsm-cam-test" <> show @Int index <> ".png")