mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_HAL_ChibiOS: 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.
This commit is contained in:
committed by
Andrew Tridgell
parent
680d158f59
commit
4ca0f35943
@@ -722,10 +722,9 @@ void Util::log_stack_info(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(HAL_BOOTLOADER_BUILD)
|
||||
#if AP_CRASHDUMP_ENABLED
|
||||
size_t Util::last_crash_dump_size() const
|
||||
{
|
||||
#if HAL_CRASHDUMP_ENABLE
|
||||
// get dump size
|
||||
uint32_t size = stm32_crash_dump_size();
|
||||
char* dump_start = (char*)stm32_crash_dump_addr();
|
||||
@@ -738,22 +737,16 @@ size_t Util::last_crash_dump_size() const
|
||||
size = stm32_crash_dump_max_size();
|
||||
}
|
||||
return size;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* Util::last_crash_dump_ptr() const
|
||||
{
|
||||
#if HAL_CRASHDUMP_ENABLE
|
||||
if (last_crash_dump_size() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return (void*)stm32_crash_dump_addr();
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
#endif // HAL_BOOTLOADER_BUILD
|
||||
#endif // AP_CRASHDUMP_ENABLED
|
||||
|
||||
// set armed state
|
||||
void Util::set_soft_armed(const bool b)
|
||||
|
||||
Reference in New Issue
Block a user