8000 New proposal for improved approach to handle MCU reset with RTS and DTR sequence · Issue #824 · cncjs/cncjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New proposal for improved approach to handle MCU reset with RTS and DTR sequence #824
Open
@cheton

Description

@cheton

See #813 (review)

MitchBradley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0