From dd3dfd9f2a8c3dd002fe494c8e4935d723f31fa4 Mon Sep 17 00:00:00 2001 From: "tridge60@gmail.com" Date: Mon, 1 Aug 2011 10:06:15 +0000 Subject: [PATCH] re-apply DEFAULT_LOG_BITMASK patch Jason, I assume you removed this patch accidentially git-svn-id: https://arducopter.googlecode.com/svn/trunk@2995 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/Log.pde | 1 - ArduCopterMega/Parameters.h | 2 +- ArduCopterMega/config.h | 17 +++++++++++++++++ ArduCopterMega/defines.h | 1 - ArduCopterMega/setup.pde | 25 ------------------------- ArduCopterMega/system.pde | 4 ---- 6 files changed, 18 insertions(+), 32 deletions(-) diff --git a/ArduCopterMega/Log.pde b/ArduCopterMega/Log.pde index 46dc70133b..9f032d7e58 100644 --- a/ArduCopterMega/Log.pde +++ b/ArduCopterMega/Log.pde @@ -170,7 +170,6 @@ select_logs(uint8_t argc, const Menu::arg *argv) // if (!strcasecmp_P(argv[1].str, PSTR("all"))) { bits = ~0; - bits = bits ^ MASK_LOG_SET_DEFAULTS; } else { #define TARG(_s) if (!strcasecmp_P(argv[1].str, PSTR(#_s))) bits |= MASK_LOG_ ## _s TARG(ATTITUDE_FAST); diff --git a/ArduCopterMega/Parameters.h b/ArduCopterMega/Parameters.h index e7aa814422..0642fe4fc9 100644 --- a/ArduCopterMega/Parameters.h +++ b/ArduCopterMega/Parameters.h @@ -316,7 +316,7 @@ public: pitch_max (PITCH_MAX * 100, k_param_pitch_max, PSTR("PITCH_MAX")), - log_bitmask (MASK_LOG_SET_DEFAULTS, k_param_log_bitmask, PSTR("LOG_BITMASK")), + log_bitmask (DEFAULT_LOG_BITMASK, k_param_log_bitmask, PSTR("LOG_BITMASK")), RTL_altitude (ALT_HOLD_HOME * 100, k_param_RTL_altitude, PSTR("ALT_HOLD_RTL")), esc_calibrate (0, k_param_esc_calibrate, PSTR("ESC")), frame_orientation (FRAME_ORIENTATION, k_param_frame_orientation, PSTR("FRAME")), diff --git a/ArduCopterMega/config.h b/ArduCopterMega/config.h index c863890010..1525fb17f8 100644 --- a/ArduCopterMega/config.h +++ b/ArduCopterMega/config.h @@ -516,6 +516,23 @@ # define LOG_OPTFLOW DISABLED #endif +// calculate the default log_bitmask +#define LOGBIT(_s) (LOG_##_s ? MASK_LOG_##_s : 0) + +#define DEFAULT_LOG_BITMASK \ + LOGBIT(ATTITUDE_FAST) | \ + LOGBIT(ATTITUDE_MED) | \ + LOGBIT(GPS) | \ + LOGBIT(PM) | \ + LOGBIT(CTUN) | \ + LOGBIT(NTUN) | \ + LOGBIT(MODE) | \ + LOGBIT(RAW) | \ + LOGBIT(CMD) | \ + LOGBIT(CUR) | \ + LOGBIT(MOTORS) | \ + LOGBIT(OPTFLOW) + // if we are using fast, Disable Medium //#if LOG_ATTITUDE_FAST == ENABLED // #undef LOG_ATTITUDE_MED diff --git a/ArduCopterMega/defines.h b/ArduCopterMega/defines.h index db36a29be8..ce3d6fa766 100644 --- a/ArduCopterMega/defines.h +++ b/ArduCopterMega/defines.h @@ -279,7 +279,6 @@ #define MASK_LOG_CUR (1<<9) #define MASK_LOG_MOTORS (1<<10) #define MASK_LOG_OPTFLOW (1<<11) -#define MASK_LOG_SET_DEFAULTS (1<<15) // Waypoint Modes // ---------------- diff --git a/ArduCopterMega/setup.pde b/ArduCopterMega/setup.pde index 6cff757029..a3e754d21b 100644 --- a/ArduCopterMega/setup.pde +++ b/ArduCopterMega/setup.pde @@ -746,31 +746,6 @@ setup_optflow(uint8_t argc, const Menu::arg *argv) #endif - -void -default_log_bitmask() -{ - // convenience macro for testing LOG_* and setting LOGBIT_* - #define LOGBIT(_s) (LOG_##_s ? MASK_LOG_##_s : 0) - - g.log_bitmask = - LOGBIT(ATTITUDE_FAST) | - LOGBIT(ATTITUDE_MED) | - LOGBIT(GPS) | - LOGBIT(PM) | - LOGBIT(CTUN) | - LOGBIT(NTUN) | - LOGBIT(MODE) | - LOGBIT(RAW) | - LOGBIT(CMD) | - LOGBIT(CUR) | - LOGBIT(MOTORS) | - LOGBIT(OPTFLOW); - #undef LOGBIT - - g.log_bitmask.save(); -} - /***************************************************************************/ // CLI reports /***************************************************************************/ diff --git a/ArduCopterMega/system.pde b/ArduCopterMega/system.pde index 74f0b7e657..1b7f217bd1 100644 --- a/ArduCopterMega/system.pde +++ b/ArduCopterMega/system.pde @@ -150,10 +150,6 @@ static void init_ardupilot() AP_Var::load_all(); } - if (g.log_bitmask & MASK_LOG_SET_DEFAULTS) { - default_log_bitmask(); - } - #ifdef RADIO_OVERRIDE_DEFAULTS { int16_t rc_override[8] = RADIO_OVERRIDE_DEFAULTS;