mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 01:33:34 +08:00
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>
This commit is contained in:
@@ -185,12 +185,11 @@ int position_estimator_inav_main(int argc, char *argv[])
|
|||||||
return 1;
|
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],
|
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 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)
|
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");
|
FILE *f = fopen(PX4_ROOTFSDIR"/fs/microsd/inav.log", "a");
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
@@ -214,8 +213,10 @@ static void write_debug_log(const char *msg, float dt, float x_est[2], float y_e
|
|||||||
|
|
||||||
fsync(fileno(f));
|
fsync(fileno(f));
|
||||||
fclose(f);
|
fclose(f);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define write_debug_log(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* main
|
* main
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#ifdef __PX4_QURT
|
||||||
|
#include <dspal_types.h>
|
||||||
|
#endif
|
||||||
@@ -41,14 +41,11 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/wqueue.h>
|
#include <nuttx/wqueue.h>
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
#elif defined(__PX4_POSIX) || defined(__PX4_QURT)
|
#elif defined(__PX4_POSIX)
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <queue.h>
|
#include <queue.h>
|
||||||
|
#include <px4_platform_types.h>
|
||||||
#ifdef __PX4_QURT
|
|
||||||
#include <dspal_types.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user