mardi 15 décembre 2015

Maintaining a single codebase between embedded and non-embedded code

I'm working on a robotics research project that involves programming a microcontroller. I'd like to be able to decouple testing the software from testing the hardware to the greatest extent possible. This is both to increase development speed and also so that I can more easily unit test/simulate the code before putting it on the robot. So for example, I might write a "MyRobot" library. Then I could include this library both in the embedded code and my non-embedded simulation/testing code. At runtime, I'd provide function pointers that would either read (in the embedded case) or simulate (in the simulation) sensor data and feed that into the library.

So it seems like all I would need to do is generate two libraries at compile time: one for the embedded code, and one for the non-embedded code.

My question is whether or not this is feasible/if there are better ways to do it/if there are any gotcha's I should watch out for.

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire