Forgot to replace $
operator in Uart.hs
This commit is contained in:
parent
0792bf3c7d
commit
4cc8c8d430
|
@ -43,7 +43,7 @@ busValFromByte size val = case size of
|
||||||
buildRBR :: IO Byte
|
buildRBR :: IO Byte
|
||||||
buildRBR = do
|
buildRBR = do
|
||||||
c <- getCharFromTerminal
|
c <- getCharFromTerminal
|
||||||
return $ fromIntegral (ord c) -- Convert Char to Byte
|
return |> fromIntegral (ord c) -- Convert Char to Byte
|
||||||
|
|
||||||
-- Reads the Line Status Register (LSR) to check character availability
|
-- Reads the Line Status Register (LSR) to check character availability
|
||||||
buildLSR :: IO Byte
|
buildLSR :: IO Byte
|
||||||
|
@ -59,7 +59,7 @@ read :: TransactionSize -> UartAddr -> IO BusVal
|
||||||
read size addr
|
read size addr
|
||||||
| addr == rbrAddr = fmap (busValFromByte size) buildRBR
|
| addr == rbrAddr = fmap (busValFromByte size) buildRBR
|
||||||
| addr == lsrAddr = fmap (busValFromByte size) buildLSR
|
| addr == lsrAddr = fmap (busValFromByte size) buildLSR
|
||||||
| otherwise = return $ busValFromByte size 0x00
|
| otherwise = return |> busValFromByte size 0x00
|
||||||
|
|
||||||
extractLowestByte :: BusVal -> Byte
|
extractLowestByte :: BusVal -> Byte
|
||||||
extractLowestByte (BusByte b) = b
|
extractLowestByte (BusByte b) = b
|
||||||
|
@ -73,5 +73,5 @@ byteToChar = chr . fromIntegral
|
||||||
|
|
||||||
write :: BusVal -> UartAddr -> IO ()
|
write :: BusVal -> UartAddr -> IO ()
|
||||||
write val addr
|
write val addr
|
||||||
| addr == thrAddr = writeCharToTerminal $ byteToChar $ extractLowestByte val
|
| addr == thrAddr = writeCharToTerminal |> byteToChar |> extractLowestByte val
|
||||||
| otherwise = return ()
|
| otherwise = return ()
|
||||||
|
|
Loading…
Reference in a new issue