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

Show pilot name and craft name on arming screen if they are not empty #10506

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Dec 6, 2024

I need to test. But it should be straight forward.

@MrD-RC MrD-RC added this to the 8.0 milestone Dec 6, 2024
@mmosca mmosca self-requested a review December 6, 2024 12:46
Copy link
Collaborator

@mmosca mmosca left a comment

Choose a reason for hiding this comment

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

Looks straight forward.

@Jetrell
Copy link

Jetrell commented Dec 7, 2024

I read the report on Discord... I tried it with Analog and Digital.
It now displays the Craft Name on the analog and digital arming screen. Which it didn't before this, under the condition mentioned on discord.

But there appears to be some random DisplayPort issues. Whether the MSP is not keeping up or not.. This was with an F722 controller.

When it works correctly we get this.

okay arm screen

Then the next time I arm. Or after an FC reboot, I get this and other character variations as well.

Capture 2

And other characters again without a GNSS fix and Safehome position.

Capture 1

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Dec 7, 2024

It appears to be picking up a pilot name from somewhere. Presumably where there isn't one set. That would explain the erroneous characters.

@mmosca
Copy link
Collaborator

mmosca commented Dec 7, 2024

Probably uninitialized memory. Try

    char        buf[MAX(osdDisplayPort->cols, FORMATTED_DATE_TIME_BUFSIZE)] = "";
    char        buf2[MAX(osdDisplayPort->cols, FORMATTED_DATE_TIME_BUFSIZE)] = "";
    char        craftNameBuf[MAX_NAME_LENGTH] = "";
    char        versionBuf[osdDisplayPort->cols] = "";

or adding memset(buf2, 0, sizeof(buf2)); before calling osdFormatPilotName(buf2);

MrD-RC added a commit that referenced this pull request Dec 7, 2024
Fixes #10506

buf2 and craftNameBuf were not initialised. But, could have been used. Both are now initialised before use.
buf2 and craftNameBuf were not initialised. But, could have been used. Both are now initialised before use. Initialises buf2 and craftNameBuf before use. buf2 is used for pilot name. craftNameBuf is used for craft name. Both, pilot but no craft name, and vice versa would have caused the error on the unused name.
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Dec 7, 2024

That should be fixed now. There would have also been weirdness if there was a pilot name but no craft name.

@mmosca mmosca merged commit bd4561f into master Dec 8, 2024
20 checks passed
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.

3 participants