Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PINIO pins that are inverted are initially set to High and the internal state is false, which is correct. But in
pinioSet
the newState was XOR-ed with the inverted flag before comparing with the stored state. So when callingpinioSet
withon = True
, the pin was not set to Low as it should. To put the pin in the correct state, one therefore had to callpinioSet
withon = False
first.Due to this bug, it was e.g. necessary to toggle the RC transmitter switch assigned to the VTX pit switch after boot to turn off the VTX, as the VTX was on even though the RC transmitter switch was in the "VTX off position" (pit switch active).
This PR fixes this bug by XOR-ing the new state with the inverted flag when calling
IOWrite
, such that the output of the pin is inverted.