Skip to content

Commit

Permalink
[modules] nav_catapult: Avoid conditional directives
Browse files Browse the repository at this point in the history
that split up parts of statements

closes #1454
  • Loading branch information
lzmths authored and flixr committed Dec 17, 2015
1 parent dc5d20d commit c401793
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sw/airborne/modules/nav/nav_catapult.c
Expand Up @@ -34,8 +34,6 @@
* GoTo(climb)
*/



#include "generated/airframe.h"
#include "state.h"
#include "subsystems/datalink/downlink.h"
Expand Down Expand Up @@ -96,6 +94,7 @@ static float nav_catapult_y = 0;

void nav_catapult_highrate_module(void)
{
bool_t reset_lauch;
// Only run when
if (nav_catapult_armed) {
if (nav_catapult_launch < nav_catapult_heading_delay * NAV_CATAPULT_HIGHRATE_MODULE_FREQ) {
Expand All @@ -109,10 +108,11 @@ void nav_catapult_highrate_module(void)
struct Int32Vect3 accel_meas_body;
struct Int32RMat *body_to_imu_rmat = orientationGetRMat_i(&imu.body_to_imu);
int32_rmat_transp_vmult(&accel_meas_body, body_to_imu_rmat, &imu.accel);
if (ACCEL_FLOAT_OF_BFP(accel_meas_body.x) < (nav_catapult_acceleration_threshold * 9.81))
reset_lauch = ACCEL_FLOAT_OF_BFP(accel_meas_body.x) < (nav_catapult_acceleration_threshold * 9.81);
#else
if (launch != 1)
reset_lauch = launch != 1;
#endif
if (reset_lauch)
{
nav_catapult_launch = 0;
}
Expand Down

0 comments on commit c401793

Please sign in to comment.