Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2047 → Rev 2048

/branches/dongfang_FC_rewrite/uart0.c
13,6 → 13,7
#include "externalControl.h"
#include "output.h"
#include "attitude.h"
#include "commands.h"
 
#ifdef USE_DIRECT_GPS
#include "mk3mag.h"
96,10 → 97,10
"HeightPdThrottle",
"HeightIdThrottle", //25
"HeightDdThrottle",
"NaviStickPitch ",
"NaviStickRoll ",
"StickPitch ",
"StickRoll ", //30
"HeadingInDegrees",
"TargetHeadingDeg",
"Diff ",
" ", //30
"navi mode "
};
 
654,9 → 655,9
if (((data3D_interval && checkDelay(data3D_timer)) || request_data3D)
&& txd_complete) {
sendOutData('C', FC_ADDRESS, 1, (uint8_t *) &data3D, sizeof(data3D));
data3D.anglePitch = (int16_t) (angle[PITCH] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // convert to multiple of 0.1°
data3D.angleRoll = (int16_t) (angle[ROLL] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // convert to multiple of 0.1°
data3D.heading = (int16_t) (yawGyroHeading / (GYRO_DEG_FACTOR_YAW/10)); // convert to multiple of 0.1°
data3D.anglePitch = (int16_t) (attitude[PITCH] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // convert to multiple of 0.1°
data3D.angleRoll = (int16_t) (attitude[ROLL] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // convert to multiple of 0.1°
data3D.heading = (int16_t) (heading / (GYRO_DEG_FACTOR_YAW/10)); // convert to multiple of 0.1°
data3D_timer = setDelay(data3D_interval);
request_data3D = FALSE;
}
669,8 → 670,8
 
#ifdef USE_DIRECT_GPS
if((checkDelay(toMk3MagTimer)) && txd_complete) {
toMk3Mag.attitude[0] = (int16_t)((10 * angle[PITCH]) / GYRO_DEG_FACTOR_PITCHROLL); // approx. 0.1 deg
toMk3Mag.attitude[1] = (int16_t)((10 * angle[ROLL]) / GYRO_DEG_FACTOR_PITCHROLL); // approx. 0.1 deg
toMk3Mag.attitude[0] = (int16_t)(attitude[PITCH] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // approx. 0.1 deg
toMk3Mag.attitude[1] = (int16_t)(attitude[ROLL] / (GYRO_DEG_FACTOR_PITCHROLL/10)); // approx. 0.1 deg
toMk3Mag.userParam[0] = dynamicParams.userParams[0];
toMk3Mag.userParam[1] = dynamicParams.userParams[1];
toMk3Mag.calState = compassCalState;