aboutsummaryrefslogtreecommitdiff
path: root/hsm-cam/Hsm/Cam.hs
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-08-27 04:10:47 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-08-27 04:17:18 +0000
commitec1a6fba4c944d95edb2397b47b6cebc59e2758d (patch)
tree48e4eccaa30f6607ceac01e1f97007b8d39f0f00 /hsm-cam/Hsm/Cam.hs
parent3806bd1f5ce56afdbb4cc0c1ed54d53e25603be2 (diff)
Moves commonly used `bracket` combinators into separate module
Diffstat (limited to 'hsm-cam/Hsm/Cam.hs')
-rw-r--r--hsm-cam/Hsm/Cam.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/hsm-cam/Hsm/Cam.hs b/hsm-cam/Hsm/Cam.hs
index c82cdd7..fe17057 100644
--- a/hsm-cam/Hsm/Cam.hs
+++ b/hsm-cam/Hsm/Cam.hs
@@ -44,6 +44,7 @@ import Hsm.Cam.FFI
, stopCamera
, stopCameraManager
)
+import Hsm.Core.Bracket (bracketConst, bracketLiftIO_)
import Hsm.Log (Log, Severity(Attention, Info, Trace), getLevel, logMsg, makeLoggerIO)
import MMAP (mapShared, mkMmapFlags, mmap, munmap, protRead)
import System.Directory (doesFileExist, removeFile)
@@ -127,8 +128,6 @@ runCam action = do
. bracketLiftIO_ createRequest (return ())
. bracket mapDmaBuffer unmapDmaBuffer $ \dmaBuffer -> evalStaticRep (Cam Rep {..}) action
where
- bracketConst alloc dealloc = bracket alloc dealloc . const
- bracketLiftIO_ alloc dealloc = bracket_ (liftIO alloc) (liftIO dealloc)
loggerAlloc = do
logMsg @"cam" Info "Registering FFI logger"
loggerIO <- makeLoggerIO @"cam"