Browse Source

AP_Filesystem: do not gate AP_CRASHDUMP_ENABLED on bootloader

Also rename from HAL_CRASHDUMP_ENABLE

Removes code based on define rather than creating empty functions.  Makes it clearer what's going on in the callers.
master
Peter Barker 3 years ago committed by Andrew Tridgell
parent
commit
680d158f59
  1. 6
      libraries/AP_Filesystem/AP_Filesystem_Sys.cpp

6
libraries/AP_Filesystem/AP_Filesystem_Sys.cpp

@ -135,9 +135,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags, bool allow_absolute_pa @@ -135,9 +135,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags, bool allow_absolute_pa
if (strcmp(fname, "persistent.parm") == 0) {
hal.util->load_persistent_params(*r.str);
}
#if AP_CRASHDUMP_ENABLED
if (strcmp(fname, "crash_dump.bin") == 0) {
r.str->set_buffer((char*)hal.util->last_crash_dump_ptr(), hal.util->last_crash_dump_size(), hal.util->last_crash_dump_size());
} else
}
#endif
if (strcmp(fname, "storage.bin") == 0) {
// we don't want to store the contents of storage.bin
// we read directly from the storage driver
@ -270,8 +272,10 @@ int AP_Filesystem_Sys::stat(const char *pathname, struct stat *stbuf) @@ -270,8 +272,10 @@ int AP_Filesystem_Sys::stat(const char *pathname, struct stat *stbuf)
// read every file for a directory listing
if (strcmp(pathname_noslash, "storage.bin") == 0) {
stbuf->st_size = HAL_STORAGE_SIZE;
#if AP_CRASHDUMP_ENABLED
} else if (strcmp(pathname_noslash, "crash_dump.bin") == 0) {
stbuf->st_size = hal.util->last_crash_dump_size();
#endif
} else {
stbuf->st_size = 100000;
}

Loading…
Cancel
Save