prj/pic18-repl.ss
#lang scheme/base

(require
 "pic18.ss")        ;; PIC18 compiler in a namespace

(provide pic18-repl)

(define (pic18-repl)
  ;; Serial port configuration: device baudrate. On OSX (possibly also
  ;; other BSDs), use the binary cau device instead of tty.
  (unless (current-console)
    (current-console
     '("/dev/ttyUSB0" 9600)
     ;; '("/dev/ttyS0" 9600)
     ))

  (printf "\nConsole at ~a\n" (current-console))
  (forth-command "ping")
  (repl forth-command))