OSDN Git Service

84cf92a9b2f621d9aad58f29a028d01498629ece
[fast-forth/master.git] / config / SendFile.ttl
1 ; macro called by SendSource.bat
2 ; param1 = this macro
3 ; param2 = file.4TH to send
4 ; param3 = /C = default COMx saved in TERATERM.INI.
5 ; param4 = "ECHO" | "NOECHO" | "HALF"
6 ; param5 = %deviceID% from select.bat
7
8 connect param3
9
10 inputbox 'Send this file to the MSP430FR target:' ' ' param2
11
12 setecho 0           ; no echo from Teraterm
13 showtt 0            ; close teraterm windows
14
15
16 ;logfile = '\teraterm.log'
17 ;dirname logdir param2  ; logir = dir of file.4TH to be sent
18 ;strconcat logdir logfile
19 ;logopen logdir 1
20
21
22 ; DEVICE ID TEST
23 ; ==============
24
25 sendln 'CODE ?ID'                               ; CODE ?ID
26 sendln 'CMP #0,R14 0<> IF SUB &$1A04,R14 THEN'  ; CMP #0,TOS 0<> IF SUB &DEVICEID,TOS THEN
27 sendln 'COLON '                                 ; COLON
28 sendln '$1B EMIT $63 EMIT'                      ; $1B EMIT $63 EMIT   \ send 'ESC c' (clear screen)
29 ;sendln '13 EMIT $10 EMIT'                      ; CR
30 sendln ' ABORT" Device'39's ID mismatch!" '     ; ABORT" Device's ID mismatch!"
31 sendln 'RST_RET ;'                              ; RST_RET ; 
32
33 sendln param5 ' ?ID NOECHO'    ; send: %deviceID% ?ID NOECHO
34
35 strcompare param4 'NOECHO'
36 if result = 0 then
37     send 'NOECHO ' ; clear LINE again but doesn't send new line
38     uptime timestart ; starts chrono...
39     sendfile inputstr 0
40     goto end
41 endif
42
43 strcompare param4 'HALF'
44 if result = 0 then
45     send 'NOECHO ' ; clear LINE again but doesn't send new line
46     uptime timestart ; starts chrono...
47     sendfile inputstr 0
48     send #4
49     setecho 1
50     goto end
51 endif
52
53 ; default mode = ECHO
54     sendln ' ECHO'
55     uptime timestart ; starts chrono...
56     sendfile inputstr 0
57
58 :end
59
60 uptime timeend  ; stops chrono...
61 diff = timeend - timestart
62
63 showtt 1    ; display teraterm window
64
65 sprintf2 resultat " %s download and execute: %d msec" param2 diff
66 messagebox resultat "teraterm.exe"
67
68 ;logclose
69
70 unlink
71 ;end
72
73