mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
DataFlash: add a should_log method
This commit is contained in:
parent
001d3a7118
commit
07e37281ef
@ -305,6 +305,18 @@ void DataFlash_Class::StartUnstartedLogging(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool DataFlash_Class::should_log() const
|
||||
{
|
||||
if (!vehicle_is_armed() && !log_while_disarmed()) {
|
||||
return false;
|
||||
}
|
||||
if (_next_backend == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#define FOR_EACH_BACKEND(methodcall) \
|
||||
do { \
|
||||
for (uint8_t i=0; i<_next_backend; i++) { \
|
||||
|
@ -167,6 +167,9 @@ public:
|
||||
|
||||
void Log_Write_PID(uint8_t msg_type, const PID_Info &info);
|
||||
|
||||
// returns true of logging of a message should be attempted
|
||||
bool should_log() const;
|
||||
|
||||
bool logging_started(void);
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
||||
|
Loading…
Reference in New Issue
Block a user