-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/split bindings #15
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
Conversation
- ble: BLE bindings - linklayer: lower-level - mac: MAC bindings Also added ll_sys_if, linklayer_plat bindings Added mac_sys_if.rs and fixed workflow file to conform to new crate generation CI: generate bindings before packaging also exclude wba-linklayer from workspace Add explicit version for linklayer bindings in generated crates Squashed generated bindings to single package Minimized changes between main
385f479 to
2170c0c
Compare
|
I had to leave the split crates as scaffolding since packaging the crates requires the version dependency which thereby requires publishing to crates.io (chicken vs egg problem). I'll defer to @xoviat regarding future direction of packaging. |
|
So I appreciate your work here, and I don't want to waste the effort, however, this is not the direction that I want to go with this crate. I will submit a PR to add changes to the README outlining the principles of this crate:
Why these principles? Because the exclusive purpose of this crate is to eliminate the need for users to have a C compiler installed or to download the ST git repository when building downstream crates. In fact, once the bindings are generated correctly (and I believe they mostly are at this point), there should be little need for more releases. In fact most of the work should happen in downstream crates (namely wpan) without the need for a c compiler or sources. One exception to this principle might be if you wanted to use c2rust to generate rust files, but even then, these rust files would not be included in the crate, but downstream repositories. But you could add a command to generate them to stm32-bindings-gen if you wanted to write logic to accomplish that. |
xoviat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, let discuss linklayer_plat.rs and the other files I discussed. In the C project, they are linked in as part of the user project to allow the libraries to call certain platform functionality (as opposed to passing them in as callbacks). This means that trying to build the mac_ffd.rs example that I added results in undefined symbols from these files. To resolve this, these files should be included in wpan and provide implementations of the functionality for each symbol.
|
This is an example of a file that I have already implemented correctly. It provides the same symbols as the C file and has the same structure. This is intentional so that it's easy to compare to the C file and see any mistakes that may have been made. And this is one of the files that I discussed that has not been implemented correctly. The PR to fix this would be submitted to the embassy repository, because this is rust code. And the development would be faster because you would not need to use a C compiler or download the sources. A note on the scheduler: mac_sys_if is not yet done (it has some placeholder code but that is not correct). However, the Again, sorry about wasting your time on this, and let me know if you have more questions so that you don't misuse your time again. |
linklayer-bindings: low-level bindings needed for the MAC and BLE crates to properly initializeble-bindingsmac-bindingsll_sys_if.rs,linklayer_plat.rs, andmac_sys_if.rs