IOMCU: add virtual GPIO read so relays work again #27683
Merged
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.
#25108 Added logging of relay where it only called set and wrote the log if there would be a state change. However, because pin read was never implemented on IOMCU read would always return 0 and the pin never turn off.
This fixes that by adding a "virtual read" method to get the commanded state of the IOMCU pin. Much like the DroneCAN pins this is NOT a real read, just a return of the last commanded state. However, this is enough to get relay to work again.
This also adds a getter for the IOMCU GPIO mask so its state is correctly represented in the
RCOut
send text. EG WithSERVO1_FUNCTION
-1:This fixes #27648
This has been tested on CubeOrange, however in my testing and in that of @andyp1per this functionality does not work on CubeOrangePlus. It seems to be a long standing issue, it is present in ever since the OrangePlus was added. I'm not sure why this would be. We do see the pin respond momentarily and then go low again.