Hello!
In case there is a post about this im sorry, i searched this forum and the wiki for quite some time now and couldnt find aynthing on this.
There are some constants in my code that are used to set options. Most of the options are not allowed to exceed a defined range of values. The code will be used by others as well, so I am trying to implement custom compiler errors giving a warning when a value that is not allowed has been chosen.
I checked the manual of the compiler as well, p103 of http://www.ccsinfo.com/downloads/ccs_c_manual.pdf shows how to have a custom compiler error generated:
#if BUFFER_SIZE>16
#error Buffer size is too large
#endif
This is exactly what i want, but when i add something like this to my project it doesnt have any effect.
What i did is:
const int Meas_Oversampling = 5;
#if Meas_OverSampling>4 || Meas_OverSampling<0
#error Meas_OverSampling: allowed values 0..4
#endif
compiles fine, anything I am missing there?
Greetings,
Lars