mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-02 05:17:03 +08:00
Merge pull request #1403 from paparazzi/radio_control_signs
radio-control signs conform paparazzi
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
// for timer_get_frequency
|
// for timer_get_frequency
|
||||||
#include "mcu_arch.h"
|
#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
|
// for Min macro
|
||||||
#include "std.h"
|
#include "std.h"
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,11 @@
|
|||||||
/* reverse some channels to suit Paparazzi conventions */
|
/* reverse some channels to suit Paparazzi conventions */
|
||||||
/* the maximum number of channels a Spektrum can transmit is 12 */
|
/* the maximum number of channels a Spektrum can transmit is 12 */
|
||||||
#ifndef RADIO_CONTROL_SPEKTRUM_SIGNS
|
#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
|
#endif
|
||||||
|
|
||||||
/* really for a 9 channel transmitter
|
/* really for a 9 channel transmitter
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#include "superbitrf_rc.h"
|
#include "superbitrf_rc.h"
|
||||||
#include "subsystems/radio_control.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
|
* 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;
|
out[i] = (in[i] + MAX_PPRZ) / 2;
|
||||||
Bound(out[i], 0, MAX_PPRZ);
|
Bound(out[i], 0, MAX_PPRZ);
|
||||||
} else {
|
} else {
|
||||||
out[i] = -in[i];
|
out[i] = in[i];
|
||||||
Bound(out[i], MIN_PPRZ, MAX_PPRZ);
|
Bound(out[i], MIN_PPRZ, MAX_PPRZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user