From f7d07fc146f0c47fe63ce7bc5cf41b785fb68a32 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Mon, 23 Oct 2017 17:38:52 -0700 Subject: [PATCH] Rover: always log MODE and include reason when logging is enabled --- APMrover2/defines.h | 2 +- APMrover2/system.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/APMrover2/defines.h b/APMrover2/defines.h index a9957a508b..02f7e74599 100644 --- a/APMrover2/defines.h +++ b/APMrover2/defines.h @@ -62,7 +62,7 @@ enum mode { #define MASK_LOG_PM (1<<3) #define MASK_LOG_CTUN (1<<4) #define MASK_LOG_NTUN (1<<5) -#define MASK_LOG_MODE (1<<6) +//#define MASK_LOG_MODE (1<<6) // no longer used #define MASK_LOG_IMU (1<<7) #define MASK_LOG_CMD (1<<8) #define MASK_LOG_CURRENT (1<<9) diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index c0dfaef6ff..e98f9b1ad3 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -232,10 +232,8 @@ bool Rover::set_mode(Mode &new_mode, mode_reason_t reason) old_mode.exit(); - if (should_log(MASK_LOG_MODE)) { - control_mode_reason = reason; - DataFlash.Log_Write_Mode(control_mode->mode_number(), reason); - } + control_mode_reason = reason; + DataFlash.Log_Write_Mode(control_mode->mode_number(), control_mode_reason); notify_mode((enum mode)control_mode->mode_number()); return true;