rc_datalink: actually use yaw from the 4ch message

This commit is contained in:
Felix Ruess
2011-11-06 17:15:13 +01:00
parent 9703e8019a
commit 210fb1fac1
2 changed files with 4 additions and 3 deletions
@@ -44,6 +44,7 @@ void parse_rc_3ch_datalink( uint8_t throttle_mode,
rc_dl_values[RADIO_PITCH] = pitch;
rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
rc_dl_values[RADIO_MODE] = (int8_t)mode;
rc_dl_values[RADIO_YAW] = 0;
rc_dl_frame_available = TRUE;
}
@@ -64,14 +64,14 @@ extern void parse_rc_4ch_datalink(
/**
* Macro that normalize rc_dl_values to radio values
*/
#define NormalizeRcDl(_in, _out) { \
#define NormalizeRcDl(_in, _out) { \
_out[RADIO_ROLL] = (MAX_PPRZ/128) * _in[RADIO_ROLL]; \
Bound(_out[RADIO_ROLL], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \
Bound(_out[RADIO_PITCH], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_YAW] = 0; \
_out[RADIO_YAW] = (MAX_PPRZ/128) * _in[RADIO_YAW]; \
Bound(_out[RADIO_YAW], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_THROTTLE] = ((MAX_PPRZ/128) * _in[RADIO_THROTTLE]); \
_out[RADIO_THROTTLE] = ((MAX_PPRZ/128) * _in[RADIO_THROTTLE]); \
Bound(_out[RADIO_THROTTLE], 0, MAX_PPRZ); \
_out[RADIO_MODE] = MAX_PPRZ * (_in[RADIO_MODE] - 1); \
Bound(_out[RADIO_MODE], MIN_PPRZ, MAX_PPRZ); \