AP_HAL: add system load accessor

This commit is contained in:
Andy Piper 2025-08-16 13:51:34 +01:00 committed by Andrew Tridgell
parent 6e86351aeb
commit 8200c082c5
3 changed files with 11 additions and 0 deletions

View File

@ -409,3 +409,7 @@
#ifndef HAL_REBOOT_ON_MEMORY_ERRORS
#define HAL_REBOOT_ON_MEMORY_ERRORS defined(IOMCU_FW)
#endif
#ifndef AP_CPU_IDLE_STATS_ENABLED
#define AP_CPU_IDLE_STATS_ENABLED 0
#endif

View File

@ -195,6 +195,9 @@ public:
virtual void* last_crash_dump_ptr() const { return nullptr; }
#endif
// get the system load
virtual bool get_system_load(float& avg_load, float& peak_load) const { return false; }
#if HAL_ENABLE_DFU_BOOT
virtual void boot_to_dfu(void) {}
#endif

View File

@ -175,3 +175,7 @@
#ifndef AP_BOARDCONFIG_MCU_MEMPROTECT_ENABLED
#define AP_BOARDCONFIG_MCU_MEMPROTECT_ENABLED 0
#endif // AP_BOARDCONFIG_MCU_MEMPROTECT_ENABLED
#ifndef AP_CPU_IDLE_STATS_ENABLED
#define AP_CPU_IDLE_STATS_ENABLED BOARD_FLASH_SIZE > 1024
#endif