From da75bfaf6b0fb24630a5518498a01d80d33930ce Mon Sep 17 00:00:00 2001 From: dzid26 Date: Sun, 22 Sep 2024 15:58:14 -0700 Subject: [PATCH] constParameterPointer --- board/safety.h | 2 +- board/safety_declarations.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/safety.h b/board/safety.h index 048d7cca48..b0a09a7dcb 100644 --- a/board/safety.h +++ b/board/safety.h @@ -428,7 +428,7 @@ bool max_limit_check(int val, const int MAX_VAL, const int MIN_VAL) { } // check that commanded torque value isn't too far from measured -bool dist_to_meas_check(int val, int val_last, struct sample_t *val_meas, +bool dist_to_meas_check(int val, int val_last, const struct sample_t *val_meas, const int MAX_RATE_UP, const int MAX_RATE_DOWN, const int MAX_ERROR) { // *** val rate limit check *** diff --git a/board/safety_declarations.h b/board/safety_declarations.h index 428107d6bb..f84788ea99 100644 --- a/board/safety_declarations.h +++ b/board/safety_declarations.h @@ -32,7 +32,7 @@ const uint8_t MAX_MISSED_MSGS = 10U; // sample struct that keeps 6 samples in memory -struct sample_t { +const struct sample_t { int values[MAX_SAMPLE_VALS]; int min; int max; @@ -176,7 +176,7 @@ void reset_sample(struct sample_t *sample); bool max_limit_check(int val, const int MAX, const int MIN); bool angle_dist_to_meas_check(int val, struct sample_t *val_meas, const int MAX_ERROR, const int MAX_VAL); -bool dist_to_meas_check(int val, int val_last, struct sample_t *val_meas, +bool dist_to_meas_check(int val, int val_last, const struct sample_t *val_meas, const int MAX_RATE_UP, const int MAX_RATE_DOWN, const int MAX_ERROR); bool driver_limit_check(int val, int val_last, const struct sample_t *val_driver, const int MAX, const int MAX_RATE_UP, const int MAX_RATE_DOWN,