Rover: move should_log check of log bitmask into DataFlash

This commit is contained in:
Peter Barker 2017-06-27 15:24:14 +10:00 committed by Francisco Ferreira
parent 88a7167cb9
commit 8697faa44f
2 changed files with 2 additions and 5 deletions

View File

@ -24,7 +24,7 @@ Rover::Rover(void) :
channel_steer(nullptr),
channel_throttle(nullptr),
channel_learn(nullptr),
DataFlash{FIRMWARE_STRING},
DataFlash{FIRMWARE_STRING, g.log_bitmask},
modes(&g.mode1),
L1_controller(ahrs, nullptr),
nav_controller(&L1_controller),

View File

@ -502,10 +502,7 @@ uint8_t Rover::check_digital_pin(uint8_t pin)
*/
bool Rover::should_log(uint32_t mask)
{
if (!(mask & g.log_bitmask)) {
return false;
}
if (!DataFlash.should_log()) {
if (!DataFlash.should_log(mask)) {
return false;
}
start_logging();