diff options
author | Paul Oliver <contact@pauloliver.dev> | 2025-07-02 15:06:35 +0200 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2025-08-13 23:54:10 +0000 |
commit | 8fe62292f18f4577303a868a8557b0486b218bcb (patch) | |
tree | cb9a9108eea479e932f37d03cf399b680e3886b2 /hsm-bin | |
parent | 0be7f1274e0cb8406bd4262b86d5e2e9dda77d7a (diff) |
Code now uses `effectful` to manage side-effects
Diffstat (limited to 'hsm-bin')
-rw-r--r-- | hsm-bin/Test/Drive.hs | 22 | ||||
-rw-r--r-- | hsm-bin/Test/Status.hs | 18 | ||||
-rw-r--r-- | hsm-bin/hsm-bin.cabal | 34 |
3 files changed, 0 insertions, 74 deletions
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 diff --git a/hsm-bin/hsm-bin.cabal b/hsm-bin/hsm-bin.cabal deleted file mode 100644 index de6e1a5..0000000 --- a/hsm-bin/hsm-bin.cabal +++ /dev/null @@ -1,34 +0,0 @@ -cabal-version: 3.4 -author: Paul Oliver -build-type: Simple -maintainer: contact@pauloliver.dev -name: hsm-bin -version: 0.1.0.0 - -common test-executable - build-depends: - , base - , hsm-gpio - , hsm-readline - , io-region - , monad-loops - - ghc-options: -Wall -Wunused-packages - - if !arch(x86_64) - ghc-options: -optl=-mno-fix-cortex-a53-835769 - - default-language: GHC2021 - -executable test-status - import: test-executable - build-depends: hsm-status - main-is: Test/Status.hs - -executable test-drive - import: test-executable - build-depends: - , hsm-drive - , hsm-pwm - - main-is: Test/Drive.hs |