packages feed

usb-safe 0.11.0.1 → 0.11.0.2

raw patch · 2 files changed

+14/−12 lines, 2 filesdep ~iterateedep ~usb

Dependency ranges changed: iteratee, usb

Files

System/USB/Safe.hs view
@@ -177,7 +177,7 @@  -- from base: import Control.Concurrent.MVar    ( MVar, newMVar, takeMVar, putMVar, withMVar )-import Control.Monad              ( Monad, return, (>>=), (>>), when, liftM )+import Control.Monad              ( Monad, return, (>>=), (>>), liftM ) import Control.Exception          ( Exception, throwIO ) import Data.Typeable              ( Typeable ) import Data.Function              ( ($) )@@ -190,7 +190,7 @@ import System.IO                  ( IO ) import Text.Show                  ( Show ) -#if __GLASGOW_HASKELL__ < 701+#if __GLASGOW_HASKELL__ < 700 import Prelude                    ( fromInteger ) import Control.Monad              ( fail ) #endif@@ -544,7 +544,7 @@           → cr α setConfig (Config (RegionalDeviceHandle internalDevHndl mv _) configDesc) f =     withUnsettedMVar mv $ do-      liftIO $ USB.setConfig internalDevHndl $ USB.configValue configDesc+      liftIO $ USB.setConfig internalDevHndl $ Just $ USB.configValue configDesc       f $ ConfigHandle internalDevHndl configDesc  -- | Internally used function which throws a 'SettingAlreadySet' exception if@@ -613,12 +613,14 @@                 → cr α useActiveConfig (RegionalDeviceHandle internalDevHndl mv _) f =     withSettedMVar mv $ do-      activeConfigValue ← liftIO $ USB.getConfig internalDevHndl-      when (activeConfigValue ≡ 0) $ P.throwIO NoActiveConfig-      let activeConfigHandle = ConfigHandle internalDevHndl activeConfigDesc-          activeConfigDesc = fromJust $ find isActive $ getConfigDescs internalDevHndl-          isActive = (activeConfigValue ≡) ∘ USB.configValue-      f activeConfigHandle+      mbActiveConfigValue ← liftIO $ USB.getConfig internalDevHndl+      case mbActiveConfigValue of+        Nothing → P.throwIO NoActiveConfig+        Just activeConfigValue →+          let activeConfigHandle = ConfigHandle internalDevHndl activeConfigDesc+              activeConfigDesc = fromJust $ find isActive $ getConfigDescs internalDevHndl+              isActive = (activeConfigValue ≡) ∘ USB.configValue+          in f activeConfigHandle  {-| This exception can be thrown in 'useActiveConfig' to indicate that the device is currently not configured.
usb-safe.cabal view
@@ -1,5 +1,5 @@ name:          usb-safe-version:       0.11.0.1+version:       0.11.0.2 cabal-version: >=1.6 build-type:    Custom license:       BSD3@@ -71,9 +71,9 @@   GHC-Options: -Wall -fno-warn-orphans   build-depends: base                      >= 4     && < 4.4                , base-unicode-symbols      >= 0.1.1 && < 0.3-               , usb                       >= 0.5   && < 0.7+               , usb                       >= 0.5   && < 0.8                , usb-enumerator            >= 0.2   && < 0.3-               , iteratee                  >= 0.3.5 && < 0.7+               , iteratee                  >= 0.3.5 && < 0.8                , bytestring                >= 0.9   && < 0.10                , regions                   >= 0.8   && < 0.9                , transformers              >= 0.2   && < 0.3