diff options
Diffstat (limited to 'hsm-pwm/Hsm/PWM.hs')
-rw-r--r-- | hsm-pwm/Hsm/PWM.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/hsm-pwm/Hsm/PWM.hs b/hsm-pwm/Hsm/PWM.hs index aa16d5c..400e704 100644 --- a/hsm-pwm/Hsm/PWM.hs +++ b/hsm-pwm/Hsm/PWM.hs @@ -101,9 +101,7 @@ setCycleDuration channel cycleDuration = do setEnable channel True runPWM - :: (IOE :> es, Log "pwm" :> es, Resource :> es) - => Eff (PWM : es) a - -> Eff es a + :: (IOE :> es, Log "pwm" :> es, Resource :> es) => Eff (PWM : es) a -> Eff es a runPWM action = evalStaticRep (PWM ()) $ do void $ allocateEff_ pwmAlloc pwmDealloc @@ -126,8 +124,7 @@ runPWM action = waitWritable exportPath waitWritable unexportPath forM_ allChannels $ \channel -> do - logMsg Info $ - "Exporting channel " <> show channel <> " on chip " <> chipPath + logMsg Info $ "Exporting channel " <> show channel <> " on chip " <> chipPath liftIO . writeFile exportPath $ show (channelIndex channel) waitWritable $ enablePath channel waitWritable $ periodPath channel @@ -136,6 +133,5 @@ runPWM action = pwmDealloc = forM_ allChannels $ \channel -> do setEnable channel False - logMsg Info $ - "Unexporting channel " <> show channel <> " on chip " <> chipPath + logMsg Info $ "Unexporting channel " <> show channel <> " on chip " <> chipPath liftIO . writeFile unexportPath $ show (channelIndex channel) |