From 806bc4898b1e99976251d4c5329420a662dd41b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 1 Feb 2021 13:26:34 -0300 Subject: [PATCH] AP_Scheduler: Add missing const in member functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_Scheduler/AP_Scheduler.cpp | 2 +- libraries/AP_Scheduler/AP_Scheduler.h | 2 +- libraries/AP_Scheduler/PerfInfo.cpp | 2 +- libraries/AP_Scheduler/PerfInfo.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Scheduler/AP_Scheduler.cpp b/libraries/AP_Scheduler/AP_Scheduler.cpp index 38dd44a305..84cf2b28d3 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.cpp +++ b/libraries/AP_Scheduler/AP_Scheduler.cpp @@ -256,7 +256,7 @@ void AP_Scheduler::run(uint32_t time_available) /* return number of micros until the current task reaches its deadline */ -uint16_t AP_Scheduler::time_available_usec(void) +uint16_t AP_Scheduler::time_available_usec(void) const { uint32_t dt = AP_HAL::micros() - _task_time_started; if (dt > _task_time_allowed) { diff --git a/libraries/AP_Scheduler/AP_Scheduler.h b/libraries/AP_Scheduler/AP_Scheduler.h index 5be7bdd34b..1e8e749fc3 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.h +++ b/libraries/AP_Scheduler/AP_Scheduler.h @@ -108,7 +108,7 @@ public: void run(uint32_t time_available); // return the number of microseconds available for the current task - uint16_t time_available_usec(void); + uint16_t time_available_usec(void) const; // return debug parameter uint8_t debug_flags(void) { return _debug; } diff --git a/libraries/AP_Scheduler/PerfInfo.cpp b/libraries/AP_Scheduler/PerfInfo.cpp index 6e59e1ef16..284fd8fb23 100644 --- a/libraries/AP_Scheduler/PerfInfo.cpp +++ b/libraries/AP_Scheduler/PerfInfo.cpp @@ -160,7 +160,7 @@ float AP::PerfInfo::get_filtered_time() const return filtered_loop_time; } -void AP::PerfInfo::update_logging() +void AP::PerfInfo::update_logging() const { gcs().send_text(MAV_SEVERITY_WARNING, "PERF: %u/%u [%lu:%lu] F=%uHz sd=%lu Ex=%lu", diff --git a/libraries/AP_Scheduler/PerfInfo.h b/libraries/AP_Scheduler/PerfInfo.h index c3dd1f5eda..b763d84228 100644 --- a/libraries/AP_Scheduler/PerfInfo.h +++ b/libraries/AP_Scheduler/PerfInfo.h @@ -34,7 +34,7 @@ public: float get_filtered_time() const; void set_loop_rate(uint16_t rate_hz); - void update_logging(); + void update_logging() const; // allocate the array of task statistics for use by @SYS/tasks.txt void allocate_task_info(uint8_t num_tasks);