Command to change the debug serial baudrate
mroavi opened this issue · 5 comments
It would be nice to have a command that could be used in a mapping to update the default debug serial baudrate.
Do you mean a command to manually specify the baud rate? Because that's done by simply setting let g:arduino_serial_baud = 9600
Lines 104 to 106 in 1a4fd15
Or do you mean a command to do the automatic baud rate detection on the current file? There's no command for that currently but you could easily map the function call
vim-arduino/ftplugin/arduino.vim
Lines 16 to 18 in 1a4fd15
Mmm... I mean a command of this type:
The main commands you will want to use are:
:ArduinoChooseBoard - Select the type of board from a list.
:ArduinoChooseProgrammer - Select the programmer from a list.
:ArduinoChoosePort - Select the serial port from a list.
:ArduinoVerify - Build the sketch.
:ArduinoUpload - Build and upload the sketch.
:ArduinoSerial - Connect to the board for debugging over a serial port.
:ArduinoUploadAndSerial - Build, upload, and connect for debugging.
:ArduinoInfo - Display internal information. Useful for debugging issues with vim-arduino.
So that I can invoke it with a key binding for convenience.
It's still not clear to me if what you want to do with your keybinding is set the baud rate to a value or perform the auto detection.
Assuming it's the auto detection, you can already do that by calling the function arduino#SetAutoBaud()
nnoremap <buffer> <leader>b :call arduino#SetAutoBaud()<CR>I would like to have a command mapped to a key binding that has the exact same functionality as let g:arduino_serial_baud = 9600. I usually have several sketches open that use different debug serial baudrates, so it would be great to (1) be able to configure them with a mapping (and not having to look for my .vimrc, edit it, and source it) and 2. make this variable buffer specific, so that I could for example use 9600 with one sketch, and 115200 with another one.
Gotcha! That's a pretty easy add