Skip to content

C99 and C++ Cleanup - #1

Open
andyp1per wants to merge 1 commit into
SpektrumRC:masterfrom
andyp1per:pr-cpp-code-cleanup
Open

C99 and C++ Cleanup#1
andyp1per wants to merge 1 commit into
SpektrumRC:masterfrom
andyp1per:pr-cpp-code-cleanup

Conversation

@andyp1per

Copy link
Copy Markdown

This is the minimal set of changes that are needed to include SRXL2 as-is in ArduPilot.
There are no functional changes other than for third-parties to be able to provide the CRC16 function.

  • Allow the code to compile without error or warning under both C99 and C++
  • Allow flight control software to provide critical defines for PACKED and FALLTHROUGH
  • Allow flight control software to provide its own CRC16 implementation

I will do a separate PR for an alternative more modular API that will make it easier to integrate in a type-safe way with other software.

Allow the code to compile without error or warning under both C99 and C++
Allow flight control software to provide critical defines for PACKED and FALLTHROUGH
Allow flight control software to provide it's own CRC16 implementation
@TaliesinToo

Copy link
Copy Markdown

Just a quick update to let you know that some of these changes are easily managed, but some are made more complicated by the way we have separated master-only code to it's own non-public file for our internal use -- adding static to many of these entries is not easily done because of that.

We also have our own separate version control that we use internally, so I am still working out the easiest way to handle pull requests like this while also keeping things synced. SO I haven't forgotten, and we're not ignoring you, but it might be a while yet.

@andyp1per

Copy link
Copy Markdown
Author

Thanks - we are getting close to committing this support into ardupilot as you can see in the linked PR. When we have done that I am happy to add the details to the README.md as part of this PR if that would be appropriate.
In that PR you can also see a sketch of how the API might be improved: ArduPilot/ardupilot#13923 (comment) let me know if you want me to cook up a PR for this or whether that's going to be too difficult to incorporate. The main issue is the use of global variables for exchanging information from the driver and the use of global functions as callbacks rather than some kind of callback structure.

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.

2 participants