Skip to content

Commit

Permalink
Fix runtime error on Windows (#6)
Browse files Browse the repository at this point in the history
* Fix #5
* Update Comm.hsc
  • Loading branch information
edmundnoble authored Jan 15, 2024
1 parent c3952a2 commit bc25597
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions System/Win32/Comm.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fRtsEnable = (#const RTS_CONTROL_ENABLE) `shift` 12

instance Storable SerialPortSettings where
sizeOf _ = #{size DCB}
alignment = sizeOf
alignment _ = 16
poke buf settings = do
#{poke DCB, DCBlength} buf (sizeOf settings)
#{poke DCB, BaudRate} buf (fromIntegral (commSpeedToBaudRate (commSpeed settings)) :: DWORD)
Expand Down Expand Up @@ -138,7 +138,7 @@ data COMMTIMEOUTS = COMMTIMEOUTS

instance Storable COMMTIMEOUTS where
sizeOf _ = #{size COMMTIMEOUTS}
alignment = sizeOf
alignment _ = 16
poke buf ct = do
#{poke COMMTIMEOUTS, ReadIntervalTimeout} buf (readIntervalTimeout ct)
#{poke COMMTIMEOUTS, ReadTotalTimeoutMultiplier} buf ( readTotalTimeoutMultiplier ct)
Expand Down Expand Up @@ -229,4 +229,4 @@ commSpeedToBaudRate cs =
CS19200 -> (#const CBR_19200)
CS38400 -> (#const CBR_38400)
CS57600 -> (#const CBR_57600)
CS115200 -> (#const CBR_115200)
CS115200 -> (#const CBR_115200)

0 comments on commit bc25597

Please sign in to comment.