Description
See #813 (review)
The code seems solid but I think there is a better approach. Some MCUs, including ESP32, require a pulse on RTS with DTR held in a particular state. To handle this, I propose a string whose characters define a sequence of states:
d means DTR low
D means DTR high
r means RTS low
R means RTS high
nnn (a decimal number) means delay that many milliseconds
optional spaces for readability
An ESP32 reset would thus be "Dr50R". The existing cases could be handled with, for example, "", "d", "D", "r", "R", "dR", etc. There would only need to be one variable that could handle all situations. It could even handle delay-after-open with just a number, like "1000" for wait one second before proceeding.A little more refinement:
empty string means "perform the controller-specific default reset sequence"
"0" means "do nothing, overriding the controller's default sequence". It is equivalent to "delay 0 milliseconds", so does not require a special case in the parser