From 8fe62292f18f4577303a868a8557b0486b218bcb Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Wed, 2 Jul 2025 15:06:35 +0200 Subject: Code now uses `effectful` to manage side-effects --- hsm-bin/Test/Drive.hs | 22 ---------------------- hsm-bin/Test/Status.hs | 18 ------------------ 2 files changed, 40 deletions(-) delete mode 100644 hsm-bin/Test/Drive.hs delete mode 100644 hsm-bin/Test/Status.hs (limited to 'hsm-bin/Test') diff --git a/hsm-bin/Test/Drive.hs b/hsm-bin/Test/Drive.hs deleted file mode 100644 index 7a58c11..0000000 --- a/hsm-bin/Test/Drive.hs +++ /dev/null @@ -1,22 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -import Control.IO.Region (region) -import Control.Monad.Loops (whileJust_) -import Hsm.Drive (DriveEnv, drive, driveEnvDefault) -import Hsm.GPIO (allocateGPIO) -import Hsm.PWM (allocatePWM) -import Hsm.Readline (allocateReadline, readline) - -newtype Env = Env - { driveEnv :: DriveEnv - } - -main :: IO () -main = - region $ \ioRegion -> do - lineRequest <- allocateGPIO ioRegion "test-status" - pwmHandle <- allocatePWM ioRegion $ const 0 - handle <- allocateReadline ioRegion - whileJust_ (readline handle) - $ drive lineRequest pwmHandle - $ Env driveEnvDefault diff --git a/hsm-bin/Test/Status.hs b/hsm-bin/Test/Status.hs deleted file mode 100644 index 62ba4fa..0000000 --- a/hsm-bin/Test/Status.hs +++ /dev/null @@ -1,18 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -import Control.IO.Region (region) -import Control.Monad.Loops (whileJust_) -import Hsm.GPIO (allocateGPIO) -import Hsm.Readline (allocateReadline, readline) -import Hsm.Status (StatusEnv, status, statusEnvDefault) - -newtype Env = Env - { statusEnv :: StatusEnv - } - -main :: IO () -main = - region $ \ioRegion -> do - lineRequest <- allocateGPIO ioRegion "test-status" - handle <- allocateReadline ioRegion - whileJust_ (readline handle) $ status lineRequest $ Env statusEnvDefault -- cgit v1.2.1