From fd2fd70a8aed840623168b3fad09345af3efda55 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 22 Sep 2024 13:46:09 +1000 Subject: [PATCH] Rover: correct initialisation of PrecLand buffers this value determines the size of buffers allocated. Too high and you waste RAM. Too low and you probably won't store data correctly. --- Rover/precision_landing.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rover/precision_landing.cpp b/Rover/precision_landing.cpp index c62b499b6a..3e6f1c105d 100644 --- a/Rover/precision_landing.cpp +++ b/Rover/precision_landing.cpp @@ -8,7 +8,9 @@ void Rover::init_precland() { - rover.precland.init(400); + // scheduler table specifies 400Hz, but we can call it no faster + // than the scheduler loop rate: + rover.precland.init(MIN(400, scheduler.get_loop_rate_hz())); } void Rover::update_precland()