I want to create a project that has both Linux and microcontroller versions with a common shared core.
I am creating this post, because I think a public discussion about this use case would benefit the community.
I have a Pine64 and a Blue Pill sitting next to me and I want to develop a project that I will be able to deploy and use on both, from the same source code.
Each version needs some extra code specific to it, but the core logic should be common.
The Linux version could have extra functionality using
std (like reporting its status over a network socket). The microcontroller version obviously needs to be no-std with its own runtime and setup code, and will have fewer features.
Further, I will probably need an abstraction for global configuration/variables, like what pins to use, which will differ between the boards.
What is the easiest way to structure such a project for minimal development/prototyping hassle? I would prefer to avoid splitting my project into multiple crates, but I am open to discussing the pros/cons of different approaches. Maybe some trickery with cargo features?
EDIT: It will control GPIO and I2C devices. I presume embedded-hal is the way to go for this, which can be backed by sysfs in the linux version and the board support crate on the microcontroller.