test compiling to reduce unwanted errors - a first approach

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

test compiling to reduce unwanted errors - a first approach

Post by Hamburger »

Hi,
with so many features available for MWii, it has become kinda risky to only guess the possible side effects of changing variable scopes, #defines, #ifs etc.. So I think it is about time we attack this issue in a coordinated way.

As a first step to at least detect compile time errors for some other config sets than the few I am working with, I have created a mechanism to test for compile time errors for a number of pre-defined copters and their variying feature sets. It is not perfect but has helped me detect some nasty side effects before submitting, so maybe it is not too bad.

At the end of config.h you will find:

/* for development only:
to allow for easier and reproducable config sets for test compiling, different sets of config parameters are kept
together. This is meant to help detecting compile time errors for various features in a coordinated way.
It is not meant to produce your flying firmware
To use:
- do not set any options in config.h,
- enable with #define COPTERTEST 1, then compile
- if possible, check for the size
- repeat with other values of 2, 3, 4 etc.
*/
//#define COPTERTEST 4

The actual sets of options are kept at the beginning of def.h. Not perfect but at least there it does not disturb the average user.
It looks like this:

Code: Select all

if COPTERTEST == 1
  #define QUADP
  #define WMP
#elif COPTERTEST == 2
...


You should add some other combinations to that list too so we will have a good amount of sets to test.
what do you think?

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: test compiling to reduce unwanted errors - a first appro

Post by Pyrofer »

Good idea, While you are at it can you find out why enabling VBAT gives errors about buzzerFreq not being defined in this scope?

It's a minefield compiling Multiwii these days.

Post Reply