Skip to content

Commit aef4ab5

Browse files
committed
Fix #35: Add a command to set the serial baud
1 parent 4de676f commit aef4ab5

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

autoload/arduino.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ function! arduino#GetSerialCmd() abort
459459
return l:cmd
460460
endfunction
461461

462+
function! arduino#SetBaud(baud) abort
463+
let g:arduino_serial_baud = a:baud
464+
endfunction
465+
462466
function! arduino#SetAutoBaud() abort
463467
let n = 1
464468
while n < line("$")

doc/arduino.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,10 @@ COMMANDS *arduino-commands
181181
Display information about the internal state of vim-arduino, including the
182182
board, port, and the command that will be run in the terminal to verify your
183183
sketch.
184+
185+
*:ArduinoSetBaud*
186+
:ArduinoSetBaud [baud]
187+
Set the baud rate used for serial connections. See |g:arduino_serial_baud|
188+
184189
===============================================================================
185190
vim:ft=help:et:ts=2:sw=2:sts=2:norl

doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
:ArduinoChooseProgrammer arduino.txt /*:ArduinoChooseProgrammer*
1919
:ArduinoInfo arduino.txt /*:ArduinoInfo*
2020
:ArduinoSerial arduino.txt /*:ArduinoSerial*
21+
:ArduinoSetBaud arduino.txt /*:ArduinoSetBaud*
2122
:ArduinoUpload arduino.txt /*:ArduinoUpload*
2223
:ArduinoUploadAndSerial arduino.txt /*:ArduinoUploadAndSerial*
2324
:ArduinoVerify arduino.txt /*:ArduinoVerify*

ftplugin/arduino.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
if exists('b:did_ftplugin')
1+
if exists('b:did_arduino_ftplugin')
22
finish
33
endif
4-
let b:did_ftplugin = 1
4+
let b:did_arduino_ftplugin = 1
55
if !exists('g:arduino_did_initialize')
66
call arduino#LoadCache()
77
call arduino#InitializeConfig()
@@ -26,3 +26,4 @@ command! -buffer -bar ArduinoUploadAndSerial call arduino#UploadAndSerial()
2626
command! -buffer -bar ArduinoGetInfo call arduino#GetInfo()
2727
command! -buffer -bar ArduinoInfo call arduino#GetInfo()
2828
command! -buffer -bar -nargs=? ArduinoChoosePort call arduino#ChoosePort(<f-args>)
29+
command! -buffer -bar -nargs=1 ArduinoSetBaud call arduino#SetBaud(<f-args>)

0 commit comments

Comments
 (0)