/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* ArduPilot filesystem interface for parameters */ #include "AP_Filesystem_config.h" #if AP_FILESYSTEM_PARAM_ENABLED #include "AP_Filesystem.h" #include "AP_Filesystem_Param.h" #include #include #include #define PACKED_NAME "param.pck" extern const AP_HAL::HAL& hal; // QURT HAL already has a declaration of errno in errno.h #if CONFIG_HAL_BOARD != HAL_BOARD_QURT extern int errno; #endif int AP_Filesystem_Param::open(const char *fname, int flags, bool allow_absolute_path) { if (!check_file_name(fname)) { errno = ENOENT; return -1; } bool read_only = ((flags & O_ACCMODE) == O_RDONLY); uint8_t idx; for (idx=0; idx