From bbbdcd32b334ae649911207e496c96c17803cf28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ji=C5=99i=C5=A1t=C4=9B?= Date: Tue, 10 Dec 2024 16:33:43 +0100 Subject: [PATCH] Make compile-time consts into constexpr I thought I did this in every file, but I forgot to do it in the PressureSensor.h one. This is now rectified. --- PressureSensor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PressureSensor.h b/PressureSensor.h index ea72baa..21fa83b 100644 --- a/PressureSensor.h +++ b/PressureSensor.h @@ -10,10 +10,10 @@ class PressureSensor const float m_resistance; // in Ohms const float m_max_pressure; - static const float MIN_CURRENT = 4e-3; // in A - static const float MAX_CURRENT = 20e-3; // in A - static const float REFERENCE_VOLTAGE = 5; // in V - static const int CONVERSION_BIT_NUM = 10; + static constexpr float MIN_CURRENT = 4e-3; // in A + static constexpr float MAX_CURRENT = 20e-3; // in A + static constexpr float REFERENCE_VOLTAGE = 5; // in V + static constexpr int CONVERSION_BIT_NUM = 10; float signal_to_pressure(int ad_signal) const; -- 2.30.2