mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 01:18:29 -04:00
AP_FileSystem: add crash_dump.bin
This commit is contained in:
parent
eee7e6cadf
commit
2af001541e
@ -46,6 +46,9 @@ static const SysFileList sysfs_file_list[] = {
|
|||||||
#if !defined(HAL_BOOTLOADER_BUILD) && (defined(STM32F7) || defined(STM32H7))
|
#if !defined(HAL_BOOTLOADER_BUILD) && (defined(STM32F7) || defined(STM32H7))
|
||||||
{"persistent.parm"},
|
{"persistent.parm"},
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAL_CRASH_DUMP_FLASHPAGE)
|
||||||
|
{"crash_dump.bin"},
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int8_t AP_Filesystem_Sys::file_in_sysfs(const char *fname) {
|
int8_t AP_Filesystem_Sys::file_in_sysfs(const char *fname) {
|
||||||
@ -127,6 +130,11 @@ int AP_Filesystem_Sys::open(const char *fname, int flags)
|
|||||||
if (strcmp(fname, "persistent.parm") == 0) {
|
if (strcmp(fname, "persistent.parm") == 0) {
|
||||||
hal.util->load_persistent_params(*r.str);
|
hal.util->load_persistent_params(*r.str);
|
||||||
}
|
}
|
||||||
|
#if defined(HAL_CRASH_DUMP_FLASHPAGE)
|
||||||
|
if (strcmp(fname, "crash_dump.bin") == 0) {
|
||||||
|
hal.util->last_crash_dump(*r.str);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (r.str->get_length() == 0) {
|
if (r.str->get_length() == 0) {
|
||||||
errno = r.str->has_failed_allocation()?ENOMEM:ENOENT;
|
errno = r.str->has_failed_allocation()?ENOMEM:ENOENT;
|
||||||
delete r.str;
|
delete r.str;
|
||||||
|
Loading…
Reference in New Issue
Block a user