Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOMCU: add virtual GPIO read so relays work again #27683

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

IamPete1
Copy link
Member

#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 With SERVO1_FUNCTION -1:

 RCOut: PWM:2-14

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.

@IamPete1 IamPete1 requested a review from andyp1per July 28, 2024 16:53
Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@tridge tridge merged commit 21ad679 into ArduPilot:master Jul 31, 2024
93 checks passed
@IamPete1 IamPete1 removed the DevCallEU label Aug 7, 2024
@rmackay9
Copy link
Contributor

I tried to include this in 4.5.6-beta1 but was unable to due to a merge conflict. If someone is keen on including this in 4.5 then a backport PR would be greatly appreciated!

@rmackay9
Copy link
Contributor

I've removed the 4.5 backports project from this PR because the above linked PR has been merged or more accurately the commits from the above linked PR have been included in this release PR #27868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RELAY set to MAIN (IOMCU) pin doesn't turn off on versions 4.5.0 and later
4 participants