From a8b07a854f87eee3c2c5fc2fae19090f0b4981dc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 9 Nov 2024 18:17:28 +1100 Subject: [PATCH] ArduSub: create and use a singleton for SRV_Channels avoid creation of static pointers to objects held within SRV_Channels --- ArduSub/ArduSub.cpp | 2 +- ArduSub/motors.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduSub/ArduSub.cpp b/ArduSub/ArduSub.cpp index df4729ba01..002fbfbaad 100644 --- a/ArduSub/ArduSub.cpp +++ b/ArduSub/ArduSub.cpp @@ -290,7 +290,7 @@ void Sub::one_hz_loop() } // update assigned functions and enable auxiliary servos - SRV_Channels::enable_aux_servos(); + AP::srv().enable_aux_servos(); #if HAL_LOGGING_ENABLED // log terrain data diff --git a/ArduSub/motors.cpp b/ArduSub/motors.cpp index 5d45a2c00f..7bfe51c249 100644 --- a/ArduSub/motors.cpp +++ b/ArduSub/motors.cpp @@ -22,7 +22,7 @@ void Sub::motors_output() SRV_Channels::calc_pwm(); SRV_Channels::output_ch_all(); motors.output(); - SRV_Channels::push(); + AP::srv().push(); } }