1 ; macro called by SendSource.bat
3 ; param2 = %~dpn1.4TH to write in SD_CARD
4 ; param3 = /C = default COMx saved in TERATERM.INI.
5 ; param4 = %deviceID% from select.bat
7 basename fname param2 ; fname = file.ext of param2
8 strinsert fname 1 '\' ; fname = \file.ext, to force absolute path
12 ;logfile = '\teraterm.log'
13 ;dirname logdir param2 ; logir = dir of file.4TH to be sent
14 ;strconcat logdir logfile
18 inputbox 'here you can change path of the file: ' 'Send this file to SD_CARD target' fname
20 setecho 0 ; no echo from Teraterm
21 showtt 0 ; close teraterm windows
26 sendln 'CODE ?ID'; CODE ?ID
27 sendln 'CMP #0,R14 0<> IF SUB &$1A04,R14 THEN'; CMP #0,TOS 0<> IF SUB &DEVICEID,TOS THEN
28 sendln 'COLON '; COLON
29 sendln '$1B EMIT $63 EMIT'; $1B EMIT $63 EMIT \ send 'ESC c' (clear screen)
30 sendln 'CR ABORT" Device'39's ID mismatch!" ' ; CR ABORT" Device's ID mismatch!"
31 sendln 'PWR_STATE ;' ; PWR_STATE ;
33 sendln param4 ' ?ID NOECHO' ; send: %deviceID% ?ID
35 sendln 'TERM2SD" ' inputstr '"' ; send to FastForth the command TERM2SD" \file.4TH" ...with optionnal path added in inputbox
37 uptime timestart ; starts chrono...
39 sendfile param2 0 ; binary flag = 0 to send text file
41 sendln #4 ; send ETX to ask TERM2SD" to close file
43 uptime timeend ; stops chrono...
44 diff = timeend - timestart
48 showtt 1 ; display teraterm window
50 sprintf2 resultat " %s download to SD Card: %d msec" param2 diff
51 messagebox resultat "teraterm.exe"