Tracker: move should_log check of log bitmask into DataFlash

This commit is contained in:
Peter Barker 2017-06-27 16:51:54 +10:00 committed by Francisco Ferreira
parent 4913fc2f2a
commit 075c40bd60
2 changed files with 2 additions and 5 deletions

View File

@ -125,7 +125,7 @@ void Tracker::ten_hz_logging_loop()
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
Tracker::Tracker(void)
: DataFlash{FIRMWARE_STRING}
: DataFlash{FIRMWARE_STRING, g.log_bitmask}
{
memset(&current_loc, 0, sizeof(current_loc));
memset(&vehicle, 0, sizeof(vehicle));

View File

@ -255,10 +255,7 @@ void Tracker::check_usb_mux(void)
*/
bool Tracker::should_log(uint32_t mask)
{
if (!(mask & g.log_bitmask)) {
return false;
}
if (!DataFlash.should_log()) {
if (!DataFlash.should_log(mask)) {
return false;
}
return true;