AP_Filesystem: raise an internal error for fileop on main thread

#ecoefi.log
This commit is contained in:
Peter Barker 2021-07-01 13:58:02 +10:00 committed by Peter Barker
parent 40a463f60c
commit 207f38dfaf
1 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,8 @@
#include "AP_Filesystem_Available.h"
#include <AP_InternalError/AP_InternalError.h>
// returned structure from a load_file() call
class FileData {
public:
@ -84,4 +86,9 @@ protected:
bool file_op_allowed(void) const;
};
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#define FS_CHECK_ALLOWED(retfail) do { if (!file_op_allowed()) { INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control); return retfail; } } while(0)
#else
#define FS_CHECK_ALLOWED(retfail) do { if (!file_op_allowed()) { return retfail; } } while(0)
#endif