1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

ahrs: whitespace adjustments

No functional changes.  Whitespace/tab fixups only.
Use TRUE/FALSE instead of 1/0.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1430 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2010-08-27 02:14:58 +00:00 committed by stac
parent 670452307d
commit 47df1faa8d
3 changed files with 83 additions and 86 deletions

View File

@ -680,9 +680,9 @@ void process_spi_request(void)
lfsm_user_set_tx_v1 (&user_tx_v1);
break;
case OPAHRS_MSG_V1_REQ_CALIBRATION:
if(user_rx_v1.payload.user.v.req.calibration.measure_var)
if(user_rx_v1.payload.user.v.req.calibration.measure_var) {
calibration_pending = TRUE;
else {
} else {
accel_var[0] = user_rx_v1.payload.user.v.req.calibration.accel_var[0];
accel_var[1] = user_rx_v1.payload.user.v.req.calibration.accel_var[1];
accel_var[2] = user_rx_v1.payload.user.v.req.calibration.accel_var[2];

View File

@ -140,8 +140,11 @@ int32_t AHRSCommsInitialize(void)
return 0;
}
static uint16_t update_errors = 0, attituderaw_errors = 0,
home_errors = 0, calibration_errors = 0, algorithm_errors = 0;
static uint16_t update_errors = 0;
static uint16_t attituderaw_errors = 0;
static uint16_t home_errors = 0;
static uint16_t calibration_errors = 0;
static uint16_t algorithm_errors = 0;
/**
* Module thread, should not return.
@ -364,22 +367,18 @@ static void load_magnetic_north(struct opahrs_msg_v1_req_north * mag_north)
mag_north->Be[1] = data.Be[1];
mag_north->Be[2] = data.Be[2];
if(data.Be[0] == 0 && data.Be[1] == 0 && data.Be[2] == 0)
{
if(data.Be[0] == 0 && data.Be[1] == 0 && data.Be[2] == 0) {
// in case nothing has been set go to default to prevent NaN in attitude solution
mag_north->Be[0] = 1;
mag_north->Be[1] = 0;
mag_north->Be[2] = 0;
}
else {
} else {
// normalize for unit length here
float len = sqrt(data.Be[0] * data.Be[0] + data.Be[1] * data.Be[1] + data.Be[2] * data.Be[2]);
mag_north->Be[0] = data.Be[0] / len;
mag_north->Be[1] = data.Be[1] / len;
mag_north->Be[2] = data.Be[2] / len;
}
}
static void load_baro_altitude(struct opahrs_msg_v1_req_update * update)
@ -389,7 +388,7 @@ static void load_baro_altitude(struct opahrs_msg_v1_req_update * update)
BaroAltitudeGet(&data);
update->barometer.altitude = data.Altitude;
update->barometer.updated = 1;
update->barometer.updated = TRUE;
}
static void load_gps_position(struct opahrs_msg_v1_req_update * update)
@ -399,18 +398,16 @@ static void load_gps_position(struct opahrs_msg_v1_req_update * update)
HomeLocationData home;
HomeLocationGet(&home);
update->gps.updated = 1;
update->gps.updated = TRUE;
if(home.RNE[0] == 0 && home.RNE[1] && home.RNE[2] == 0 && home.RNE[3] == 0)
{
if(home.RNE[0] == 0 && home.RNE[1] && home.RNE[2] == 0 && home.RNE[3] == 0) {
update->gps.NED[0] = 0;
update->gps.NED[1] = 0;
update->gps.NED[2] = 0;
update->gps.groundspeed = 0;
update->gps.heading = 0;
update->gps.quality = 0;
}
else {
} else {
update->gps.groundspeed = data.Groundspeed;
update->gps.heading = data.Heading;
update->gps.quality = 0;