HSW12 icon indicating copy to clipboard operation
HSW12 copied to clipboard

[Enhancement] Add macro to change baud

Open chrstphrchvz opened this issue 10 years ago • 4 comments

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?

chrstphrchvz avatar Mar 23 '15 00:03 chrstphrchvz

Yes, why not. It's not hard to implement. I'll do it when I find a minute.

hotwolf avatar Apr 08 '15 21:04 hotwolf

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).

chrstphrchvz avatar Apr 26 '15 04:04 chrstphrchvz

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.

hotwolf avatar May 15 '15 07:05 hotwolf

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.

chrstphrchvz avatar Apr 27 '16 19:04 chrstphrchvz