File tree 2 files changed +25
-6
lines changed
2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- # / Usage: vim-arduino <pde file> [board] [serialport]
2
+ # / Usage: vim-arduino <pde file> [board] [serialport] [sketchbook] [arduinohome]
3
3
# / Invokes the Arduino IDE command line runner to compile and deploy
4
4
# / Arduino sketches.
5
5
# /
13
13
pde_file=
14
14
board=" uno"
15
15
port=
16
+ sketchbook=
17
+ arduinohome=
16
18
switch=" -c"
17
19
18
20
while [ $# -gt 0 ]
36
38
switch=" -c"
37
39
shift
38
40
;;
41
+ -k|--sketchbook)
42
+ shift
43
+ sketchbook=$1
44
+ shift
45
+ ;;
46
+ -a|--arduinohome)
47
+ shift
48
+ arduinohome=$1
49
+ shift
50
+ ;;
39
51
* )
40
52
if [ -z " $pde_file " ]
41
53
then pde_file=" $1 "
75
87
76
88
# echo "Compiling '$pde_file' for board $board on serial port $port"
77
89
78
- sketchbook=$( echo $HOME /Documents/Arduino)
79
-
80
90
DIR=" $( cd " $( dirname " $0 " ) " && pwd ) "
81
91
java \
82
- -Djava.library.path=/Applications/Arduino.app/Contents/Resources/Java \
83
- -d32 \
92
+ -Djava.library.path=" $arduinohome " \
84
93
-Darduino.sketchbook=" $sketchbook " \
85
94
-Djava.awt.headless=true \
86
95
-jar " $DIR /vim-arduino-cli.jar" " $switch " " $pde_file " " $port " " $board "
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ if !exists('g:vim_arduino_auto_open_serial')
44
44
let g: vim_arduino_auto_open_serial = 0
45
45
endif
46
46
47
+ if ! exists (' g:vim_arduino_sketchbook' )
48
+ let g: vim_arduino_sketchbook = $HOME ." /Documents/Arduino"
49
+ endif
50
+
51
+ if ! exists (' g:vim_arduino_sdk_home' )
52
+ let g: vim_arduino_sdk_home = " /Applications/Arduino.app/Contents/Resources/Java"
53
+ endif
54
+
47
55
let s: helper_dir = expand (" <sfile>:h" )
48
56
49
57
" Private: Get the board to deploy to
@@ -104,8 +112,10 @@ function! s:InvokeArduinoCli(deploy)
104
112
let l: command = s: helper_dir . " /vim-arduino " .
105
113
\ l: flag . " " .
106
114
\ " -b " . l: board . " " .
115
+ \ " -a " . g: vim_arduino_sdk_home . " " .
116
+ \ " -k " . g: vim_arduino_sketchbook . " " .
107
117
\ shellescape (l: f_name )
108
- " echo l:command
118
+ echo l: command
109
119
let l: result = system (l: command )
110
120
call s: PrintStatus (v: shell_error )
111
121
echo l: result
You can’t perform that action at this time.
0 commit comments