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:
Peter Barker
2022-08-17 17:34:00 +10:00
committed by Andrew Tridgell
parent 680d158f59
commit 4ca0f35943
4 changed files with 7 additions and 14 deletions
+2 -9
View File
@@ -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)