diff options
author | Ta180m | 2020-02-22 07:36:06 -0600 |
---|---|---|
committer | Ta180m | 2020-02-22 07:36:06 -0600 |
commit | 02d81080b19b7c5fb35f7d03c886c83e04a1c163 (patch) | |
tree | 597e9cd3273511984196f5918cf2be4eddee104c /libraries | |
parent | 92e93933c29a4071c11a2a1b831951e1dbe5458b (diff) |
Inline functions causing problems
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/detectorBuilding/src/detectorBuilding.cpp | 18 | ||||
-rw-r--r-- | libraries/detectorBuilding/src/detectorBuilding.h | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/libraries/detectorBuilding/src/detectorBuilding.cpp b/libraries/detectorBuilding/src/detectorBuilding.cpp index 3bca44c..7b3fef7 100644 --- a/libraries/detectorBuilding/src/detectorBuilding.cpp +++ b/libraries/detectorBuilding/src/detectorBuilding.cpp @@ -10,21 +10,21 @@ // Temperature conversions -inline double f2c(double f) { return (f - 32) * 5 / 9; } // Fahrenheit to Celsius -inline double c2f(double c) { return c * 9 / 5 + 32; } // Celsius to Fahrenheit -inline double k2c(double k) { return k - 273.15; } // Kelvin to Celsius -inline double c2k(double c) { return c + 273.15; } // Celsius to Kelvin -inline double f2k(double f) { return c2k(f2c(f)); } // Fahrenheit to Kelvin -inline double k2f(double k) { return c2f(k2c(k)); } // Kelvin to Fahrenheit +double f2c(double f) { return (f - 32) * 5 / 9; } // Fahrenheit to Celsius +double c2f(double c) { return c * 9 / 5 + 32; } // Celsius to Fahrenheit +double k2c(double k) { return k - 273.15; } // Kelvin to Celsius +double c2k(double c) { return c + 273.15; } // Celsius to Kelvin +double f2k(double f) { return c2k(f2c(f)); } // Fahrenheit to Kelvin +double k2f(double k) { return c2f(k2c(k)); } // Kelvin to Fahrenheit // Analog to digital conversion -inline double a2d(int a) { return V_in * a / analog_max; } -inline int d2a(double d) { return d * analog_max / V_in; } +double a2d(int a) { return V_in * a / analog_max; } +int d2a(double d) { return d * analog_max / V_in; } // Voltage to resistance conversion -inline double v2r(double V_out) { return R_k * (V_in / V_out - 1); } +double v2r(double V_out) { return R_k * (V_in / V_out - 1); } // Utility functions diff --git a/libraries/detectorBuilding/src/detectorBuilding.h b/libraries/detectorBuilding/src/detectorBuilding.h index b82cc35..a69c77c 100644 --- a/libraries/detectorBuilding/src/detectorBuilding.h +++ b/libraries/detectorBuilding/src/detectorBuilding.h @@ -12,17 +12,17 @@ const int LED_R = 4, LED_G = 3, LED_B = 2, THERM = 0; // Device component pins const double R_k = 10000, V_in = 5, analog_max = 1023; // Device constants -inline double f2c(double f); -inline double c2f(double c); -inline double k2c(double k); -inline double c2k(double c); -inline double f2k(double f); -inline double k2f(double k); +double f2c(double f); +double c2f(double c); +double k2c(double k); +double c2k(double c); +double f2k(double f); +double k2f(double k); -inline double a2d(int a); -inline int d2a(double d); +double a2d(int a); +int d2a(double d); -inline double v2r(double V_out); +double v2r(double V_out); void sort(double a[], int n); |