Merge pull request #1403 from paparazzi/radio_control_signs

radio-control signs conform paparazzi
This commit is contained in:
Gautier Hattenberger
2015-11-13 15:12:07 +01:00
3 changed files with 10 additions and 2 deletions
@@ -35,6 +35,8 @@
// for timer_get_frequency
#include "mcu_arch.h"
INFO("Radio-Control now follows PPRZ sign convention: this means you might need to reverese some channels in your transmitter: RollRight / PitchUp / YawRight / FullThrottle / Auto2 are positive deflections")
// for Min macro
#include "std.h"
@@ -65,7 +65,11 @@
/* reverse some channels to suit Paparazzi conventions */
/* the maximum number of channels a Spektrum can transmit is 12 */
#ifndef RADIO_CONTROL_SPEKTRUM_SIGNS
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,-1,-1,-1,1,-1,1,1,1,1,1,1}
#ifdef RADIO_CONTROL_SPEKTRUM_OLD_SIGNS
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,-1,-1,-1,1,-1,1,1,1,1,1,1} // As most transmitters are sold
#else
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,1,1,1,1,1,1,1,1,1,1,1} // PPRZ sign convention
#endif
#endif
/* really for a 9 channel transmitter
@@ -26,6 +26,8 @@
#include "superbitrf_rc.h"
#include "subsystems/radio_control.h"
INFO("Radio-Control now follows PPRZ sign convention: this means you might need to reverese some channels in your transmitter: RollRight / PitchUp / YawRight / FullThrottle / Auto2 are positive deflections")
/**
* Initialization
*/
@@ -47,7 +49,7 @@ static void superbitrf_rc_normalize(int16_t *in, int16_t *out, uint8_t count)
out[i] = (in[i] + MAX_PPRZ) / 2;
Bound(out[i], 0, MAX_PPRZ);
} else {
out[i] = -in[i];
out[i] = in[i];
Bound(out[i], MIN_PPRZ, MAX_PPRZ);
}
}