Commit f4678f add missing test/SLCANPosix

1 file Authored and Committed by Richard Marko a year ago
add missing test/SLCANPosix

    
 1 @@ -0,0 +1,28 @@
 2 + {-# LANGUAGE DataKinds #-}
 3 + {-# LANGUAGE OverloadedStrings #-}
 4 + {-# LANGUAGE TypeOperators #-}
 5 + 
 6 + import Ivory.Language
 7 + import Ivory.Tower
 8 + import Ivory.Tower.HAL.Bus.Interface
 9 + import Ivory.OS.Posix.Tower
10 + import Ivory.OS.Posix.Tower.Serial
11 + 
12 + import C4D.SLCAN
13 + import Ivory.Tower.Base
14 + import Ivory.Tower.Base.UART.Types
15 + 
16 + app :: Tower e ()
17 + app = do
18 +   uartTowerDeps
19 + 
20 +   (buffered_ostream, istream) <- serialIO
21 +   ostream <- uartUnbuffer (
22 +     buffered_ostream :: BackpressureTransmit UARTBuffer ('Stored IBool))
23 + 
24 +   -- SLCAN loopback
25 +   (toCanIn, toCanOut) <- channel
26 +   slCANTower ostream istream toCanIn toCanOut (const (return ()))
27 + 
28 + main :: IO ()
29 + main = compileTowerPosix (const $ return ()) app