Code cleaning around KILRAH_OFS / FRANCK #define for one of the next code change.

Now we need to decide:
- a compile option?
- a per model option?
- a per channel option?
The per channel option is ok, we have one bit left per channel in limits (we even will save 8bits for each channel if this is the chosen option)
This commit is contained in:
bsongis
2012-08-14 17:41:20 +00:00
parent 8f103ecee3
commit 24c36f3184
+2 -9
View File
@@ -31,7 +31,6 @@
*
*/
// Here Franck you write this line "#define FRANCK" (without the "")
// KILRAH: or "#define KILRAH_OFS" for what I think is the right thing we discussed this weekend!
#if defined(PCBARM) && !defined(SIMU)
@@ -481,17 +480,11 @@ int16_t applyLimits(uint8_t channel, int32_t value)
if (ofs > lim_p) ofs = lim_p;
if (ofs < lim_n) ofs = lim_n;
#if (!defined(FRANCK) && !defined(KILRAH_OFS)) || (defined(FRANCK) && defined(KILRAH_OFS))
#if !defined(KILRAH_OFS)
if (value) value =
(value > 0) ? value * ((int32_t) lim_p - ofs) / 100000 :
-value * ((int32_t) lim_n - ofs) / 100000; //div by 100000 -> output = -1024..1024
#endif
#if defined(FRANCK) && !defined(KILRAH_OFS)
value /= 100;
#endif
#if defined(KILRAH_OFS) && !defined(FRANCK)
#else
if (value) value =
(value > 0) ? value * ((int32_t) lim_p) / 100000 :
-value * ((int32_t) lim_n) / 100000; //div by 100000 -> output = -1024..1024