Skip to content

Commit 97a3646

Browse files
committed
Updates to make things work on Linux.
1 parent 20556d4 commit 97a3646

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

build/build-linux.sh

+16-11
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,40 @@ rm -rf ${DEST}
55
mkdir -p ${DEST}
66

77
pushd ${SRC}
8+
echo Building the Flow executable.
89
raco exe --gui -o ${BASE} gui.rkt
10+
echo Sleeping
911
sleep 2
12+
echo Readying for Distribution
1013
raco distribute ${DEST} ${BASE}
11-
sleep 2
12-
chmod 755 ${DEST}/${BASE}
14+
echo Sleeping
15+
sleep 2
16+
echo Setting executable mode.
17+
chmod 755 ${DEST}/bin/${BASE}
1318
popd
1419

15-
cp -R ../bin/unix/ ${DEST}/bin/unix/
20+
echo Moving files around
1621
sleep 2
22+
cp -R ../bin/unix/ ${DEST}/bin/unix/
1723
cp -R ../config/ ${DEST}/config/
18-
sleep 2
1924
cp -R ../interface/ ${DEST}/interface/
20-
sleep 2
2125
cp -R ../occam/ ${DEST}/occam/
22-
sleep 2
2326
mkdir -p ${DEST}/temp
24-
sleep 2
2527
# Hopefully eliminating the "not found" errors
2628
# that happen... for reasons unknown.
2729
mkdir -p ${DEST}/conf
2830
touch ${DEST}/conf/not-found.html
2931

32+
echo Going up one level
3033
pushd ..
31-
tar cvzf Flow.tgz Flow/
34+
echo Zipping.
35+
tar cvzf Flow.tgz Flow/
3236

33-
if [ "${USER}" == "reynoldsm" ]; then
37+
echo If the first command line argument was "upload"...
38+
if [ "$1" = "upload" ]; then
39+
echo Uploading
3440
scp -i ~/.ssh/jadudm-rsa ${BASE}.tgz [email protected]:/srv/www/org/transterpreter.download/files/flow/
35-
fi
36-
41+
fi
3742
popd
3843

3944

server/gui.rkt

+4-3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
(open-input-file (build-port (get-data 'port)) #:mode 'binary))
275275

276276
(let loop ()
277+
(when (port? (get-data 'SERIALP))
277278
(let ([line (read-line (get-data 'SERIALP))]
278279
[txt (send
279280
(send serial-editor get-editor)
@@ -288,7 +289,7 @@
288289
(set! c 0)]
289290
[else
290291
(send serial-editor set-value txt)])
291-
)
292+
))
292293

293294
(loop))
294295
)))
@@ -308,8 +309,8 @@
308309
(thread (λ () (serve))))
309310

310311
(send serial-f show true)
311-
(set! serial-thread-id
312-
(thread (get-data 'serial-thread)))
312+
;; (set! serial-thread-id
313+
;; (thread (get-data 'serial-thread)))
313314
)))))
314315

315316
(define quit

server/system.rkt

+6-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@
244244
;; Racket nicely cleans up after us, so we kill the thread
245245
;; and the open serial port goes away.
246246
(when (get-data 'serial-thread-id)
247-
(kill-thread (get-data 'serial-thread-id)))
247+
(when (port? (get-data 'SERIALP))
248+
(close-input-port (get-data 'SERIALP)))
249+
(sleep 1)
250+
(kill-thread (get-data 'serial-thread-id))
251+
(sleep 1))
248252

249253
(when-file (tbc-file)
250254
(report 'BIN-TO-HEX " ")
@@ -293,4 +297,4 @@
293297
(avrdude-cmd ARDUINO-PORT path))))
294298

295299
(report 'FIRMWARE cmd)
296-
(exe cmd)))
300+
(exe cmd)))

0 commit comments

Comments
 (0)