Skip to content

Commit

Permalink
Add custom baud rates (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
dopamane authored Nov 23, 2024
1 parent 16a1812 commit c64a2d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ jobs:

- name: Build
run: cabal build

- name: Docs
run: cabal haddock
3 changes: 1 addition & 2 deletions System/Hardware/Serialport/Posix.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,4 @@ commSpeedToBaudRate = \case
CS38400 -> B38400
CS57600 -> B57600
CS115200 -> B115200


CS b -> fromIntegral b
4 changes: 2 additions & 2 deletions System/Hardware/Serialport/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ data CommSpeed
| CS38400
| CS57600
| CS115200
deriving (Show, Read, Eq, Bounded)
| CS Word32
deriving (Show, Read, Eq)

data StopBits = One | Two
deriving (Show, Read, Eq, Bounded)
Expand Down Expand Up @@ -54,4 +55,3 @@ data SerialPortSettings = SerialPortSettings
defaultSerialSettings :: SerialPortSettings
defaultSerialSettings =
SerialPortSettings CS9600 8 One NoParity NoFlowControl 1

1 change: 1 addition & 0 deletions System/Win32/Comm.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,4 @@ commSpeedToBaudRate cs =
CS38400 -> (#const CBR_38400)
CS57600 -> (#const CBR_57600)
CS115200 -> (#const CBR_115200)
CS b -> fromIntegral b

0 comments on commit c64a2d0

Please sign in to comment.