Browse Source

Removed __PX4_QURT ifdefs from application layer

Replaced test for __PX4_QURT with test for NAV_DEBUG.

Optimized implementation to remove code when flag is not set.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
sbg
Mark Charlebois 10 years ago
parent
commit
faae76e3c7
  1. 7
      src/modules/position_estimator_inav/position_estimator_inav_main.c
  2. 3
      src/platforms/posix/include/px4_platform_types.h
  3. 7
      src/platforms/px4_workqueue.h

7
src/modules/position_estimator_inav/position_estimator_inav_main.c

@ -185,12 +185,11 @@ int position_estimator_inav_main(int argc, char *argv[]) @@ -185,12 +185,11 @@ int position_estimator_inav_main(int argc, char *argv[])
return 1;
}
#ifdef INAV_DEBUG
static void write_debug_log(const char *msg, float dt, float x_est[2], float y_est[2], float z_est[2], float x_est_prev[2], float y_est_prev[2], float z_est_prev[2],
float acc[3], float corr_gps[3][2], float w_xy_gps_p, float w_xy_gps_v, float corr_mocap[3][1], float w_mocap_p,
float corr_vision[3][2], float w_xy_vision_p, float w_z_vision_p, float w_xy_vision_v)
{
return;
#ifndef __PX4_QURT
FILE *f = fopen(PX4_ROOTFSDIR"/fs/microsd/inav.log", "a");
if (f) {
@ -214,8 +213,10 @@ static void write_debug_log(const char *msg, float dt, float x_est[2], float y_e @@ -214,8 +213,10 @@ static void write_debug_log(const char *msg, float dt, float x_est[2], float y_e
fsync(fileno(f));
fclose(f);
#endif
}
#else
#define write_debug_log(...)
#endif
/****************************************************************************
* main

3
src/platforms/posix/include/px4_platform_types.h

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
#ifdef __PX4_QURT
#include <dspal_types.h>
#endif

7
src/platforms/px4_workqueue.h

@ -41,14 +41,11 @@ @@ -41,14 +41,11 @@
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
#include <nuttx/clock.h>
#elif defined(__PX4_POSIX) || defined(__PX4_QURT)
#elif defined(__PX4_POSIX)
#include <stdint.h>
#include <queue.h>
#ifdef __PX4_QURT
#include <dspal_types.h>
#endif
#include <px4_platform_types.h>
__BEGIN_DECLS

Loading…
Cancel
Save