Closed hkzlab closed 1 year ago
I think it would make more sense to add a parameter to the autoreset argument, i.e. --autoreset=[normal|inverted]
. Of course, if no parameter is specified it should default to normal. The options for autoreset are so cluttered already after all. What do you think?
Makes sense, in fact I was a bit conflicted on how to pass the parameter through
On second thought, maybe -A
should be extended, with new inverted pin modes. Makes more sense and is even simpler. So you'd have e.g. dtr_inverted
and rts_inverted
.
@grigorig that was actually my second idea on how to pass it through. I'll get right to it.
@grigorig done. I simply appended the new cases to the if chain already present in reset_device
, Given that there aren't many more pins to use for reset it did not seem worth to play clever and try to distinguish the same pin being inverted or not by checking the _inverted string
Yeah, LGTM.
There is some issue with GitHub Actions, I'll just squash and merge nonetheless.
This PR adds a -i / --invertreset option for the --autoreset function. One of my boards (made by PRECHIN) requires an inverted assertion of the DTR signal to cycle the power, otherwise it remains powered off.
I originally tried implementing the reset using an external command, but given that the serial port was already opened by stcgal and thus inaccessible to my tool (at least on Windows), I opted for this small change.