[Enhancement] Add macro to change baud
An idea I had is to be able create a "turbo" button macro to set a faster baud for the selected device. This should be possible by adding a [baud <bps>] macro, though I might not get a chance to implement it myself anytime soon.
Does this sound like a good feature to add?
Yes, why not. It's not hard to implement. I'll do it when I find a minute.
I was able use the other macros as examples to get a working baud macro, and I've pushed this to a new "baudmacro" branch (f419e1bc2ef8ec2438db69e9a9ae838d5209c1a2). It should be using the same subroutines as would be used if set from the menu, and I added a flag macro_allow_baud, although I'm not sure how these flags are used, so I added it where most other flags have been used. I also haven't added any comments or documentation.
This also isn't usable right away as part of a simple multiline macro, at least on OS X: using
baud 38400
[baud 38400]
will change the baud used by HSW12 POD, but before it has even sent the first line of the macro (the board receives garbage).
Hello Christopher, sorry for the late reply. I've started to implement the baud macro myself, but I'm not done with it, yet. The purpose of the flags is to prevent the macro from being evaluated where it doesn't make sense (for example during a refresh of the memory display). I'll have a look at your branch, as soon as I have a minute.
I think one solution to prevent the baud from changing before any earlier text/commands in a macro finish sending might be to first use $self->{output_handle}->flush(), but I have yet to test if this effective for serial ports on Linux or OS X.