Skip to content

Commit

Permalink
Stylistic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Nov 10, 2010
1 parent 2366f67 commit e202d7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/Compass.hs
Expand Up @@ -11,7 +11,6 @@ module NXT.Compass (
) where

import Control.Monad
import Data.Word

import NXT.NXT
import NXT.Data
Expand Down Expand Up @@ -39,7 +38,7 @@ csInit :: InputPort -> NXT ()
csInit input = do
setInputModeConfirm input Lowspeed9V RawMode
ready <- lowspeedGetStatus input
when (ready > 0) $ do lowspeedRead input ; return () -- clears any possible pending data in the buffer
when (ready > 0) $ lowspeedRead input >> return () -- clears any possible pending data in the buffer
csSetMode input ResultInteger

csReadByte :: Integral a => InputPort -> Command -> NXT a
Expand Down
4 changes: 2 additions & 2 deletions lib/Types.hs
Expand Up @@ -78,8 +78,8 @@ data SensorMode =
| FahrenheitMode
| AngleStepsMode -- reports scaled value as count of ticks on RCX-style rotation sensor
-- two modes unnecessary?
-- | SlopeMask
-- | ModeMask
-- SlopeMask
-- ModeMask
deriving (Eq, Show)
type RawADValue = Int
type NormalizedADValue = Int -- normalized A/D value, in [0, 1023] range
Expand Down
3 changes: 1 addition & 2 deletions lib/UltrasonicSensor.hs
Expand Up @@ -29,7 +29,6 @@ module NXT.NXTUltrasonicSensor (
import Control.Exception
import Control.Monad
import Control.Monad.Trans
import Data.Word

import NXT.NXT
import NXT.Data
Expand Down Expand Up @@ -62,7 +61,7 @@ usInit :: InputPort -> NXT ()
usInit input = do
setInputModeConfirm input Lowspeed9V RawMode
ready <- lowspeedGetStatus input
when (ready > 0) $ do lowspeedRead input ; return () -- clears any possible pending data in the buffer
when (ready > 0) $ lowspeedRead input >> return () -- clears any possible pending data in the buffer
usSetCommandState input WarmReset

usReadByte :: Integral a => InputPort -> Command -> NXT a
Expand Down

0 comments on commit e202d7e

Please sign in to comment.