afry-south / dragonfly-fcb

ÅF Dragonfly Quadrotor UAV Project
Other
7 stars 3 forks source link

create __FCB_RELEASE/DEBUG/TEST__ macro #defines #120

Open adam-at-epsilon opened 8 years ago

adam-at-epsilon commented 8 years ago

Configure preprocessor macro defines named for configurations

Debug: -D __FCB_DEBUG__ Release: -D __FCB_RELEASE__ Test: -D __FCB_TEST__

This will allow us to use #ifdef __FCB_RELEASE/DEBUG/TEST__ sections in the code.

This will allow us to exclude test/debug code from the release, or have special settings for the release version.

adam-at-epsilon commented 8 years ago

We now have __FCB_DEBUG__ and __FCB_RELEASE__, but __FCB_TEST__ will have to wait until whenever we have a Test release.

adam-at-epsilon commented 8 years ago

This will help us differentiate for instance error handling and printing to console behaviour between test/debug/release phases.

stenbergd commented 8 years ago

I agree. Perhaps we should make a few more build configurations with different project define setups?

Maybe we should consider a #define that disables any writing to the motors for safe testing?

And perhaps another one that simply runs some unit tests?

adam-at-epsilon commented 8 years ago

All good suggestions. One build configuration for unit test and perhaps another for calibration?

Perhaps the motors should be disabled by default in the code and we have to add a define to enable them?

stenbergd commented 8 years ago

Probably a good idea, yes. One could always update the motor values, but not outputting them on the actual pins unless we define MOTOR_OUTPUT_ENABLED