Make compile-time consts into constexpr
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 15:33:43 +0000 (16:33 +0100)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 15:33:43 +0000 (16:33 +0100)
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

index ea72baa1cf3d04078298ef544337641bb5a18b4d..21fa83b6bd3f2c4f102d36342e75f9a82996102a 100644 (file)
@@ -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;