Rover: always log MODE and include reason when logging is enabled

This commit is contained in:
Tom Pittenger 2017-10-23 17:38:52 -07:00 committed by Andrew Tridgell
parent e340fac2e0
commit f7d07fc146
2 changed files with 3 additions and 5 deletions

View File

@ -62,7 +62,7 @@ enum mode {
#define MASK_LOG_PM (1<<3) #define MASK_LOG_PM (1<<3)
#define MASK_LOG_CTUN (1<<4) #define MASK_LOG_CTUN (1<<4)
#define MASK_LOG_NTUN (1<<5) #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_IMU (1<<7)
#define MASK_LOG_CMD (1<<8) #define MASK_LOG_CMD (1<<8)
#define MASK_LOG_CURRENT (1<<9) #define MASK_LOG_CURRENT (1<<9)

View File

@ -232,10 +232,8 @@ bool Rover::set_mode(Mode &new_mode, mode_reason_t reason)
old_mode.exit(); old_mode.exit();
if (should_log(MASK_LOG_MODE)) {
control_mode_reason = reason; control_mode_reason = reason;
DataFlash.Log_Write_Mode(control_mode->mode_number(), reason); DataFlash.Log_Write_Mode(control_mode->mode_number(), control_mode_reason);
}
notify_mode((enum mode)control_mode->mode_number()); notify_mode((enum mode)control_mode->mode_number());
return true; return true;