Browse Source

Sub: move should_log check of log bitmask into DataFlash

mission-4.1.18
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
4913fc2f2a
  1. 2
      ArduSub/Sub.cpp
  2. 5
      ArduSub/system.cpp

2
ArduSub/Sub.cpp

@ -21,7 +21,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
constructor for main Sub class constructor for main Sub class
*/ */
Sub::Sub(void) : Sub::Sub(void) :
DataFlash {FIRMWARE_STRING}, DataFlash {FIRMWARE_STRING, g.log_bitmask},
mission(ahrs, mission(ahrs,
FUNCTOR_BIND_MEMBER(&Sub::start_command, bool, const AP_Mission::Mission_Command &), FUNCTOR_BIND_MEMBER(&Sub::start_command, bool, const AP_Mission::Mission_Command &),
FUNCTOR_BIND_MEMBER(&Sub::verify_command_callback, bool, const AP_Mission::Mission_Command &), FUNCTOR_BIND_MEMBER(&Sub::verify_command_callback, bool, const AP_Mission::Mission_Command &),

5
ArduSub/system.cpp

@ -291,10 +291,7 @@ bool Sub::optflow_position_ok()
bool Sub::should_log(uint32_t mask) bool Sub::should_log(uint32_t mask)
{ {
#if LOGGING_ENABLED == ENABLED #if LOGGING_ENABLED == ENABLED
if (!(mask & g.log_bitmask)) { if (!DataFlash.should_log(mask)) {
return false;
}
if (!DataFlash.should_log()) {
return false; return false;
} }
start_logging(); start_logging();

Loading…
Cancel
Save