diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-12 12:53:11 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-12 12:53:14 +0200 |
commit | 2823a0d3833ba5faa03590dfbc5c45976439cd59 (patch) | |
tree | a2617227a4062b4e17377ec51592fb5752b32e28 | |
parent | a7013d0670fad5d5765393bc7d70b51e32733f21 (diff) | |
download | glutte-o-matic-2823a0d3833ba5faa03590dfbc5c45976439cd59.tar.gz glutte-o-matic-2823a0d3833ba5faa03590dfbc5c45976439cd59.tar.bz2 glutte-o-matic-2823a0d3833ba5faa03590dfbc5c45976439cd59.zip |
fix variable name and remove useless sqrtf call
-rw-r--r-- | src/glutt-o-logique/analog_input.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/glutt-o-logique/analog_input.c b/src/glutt-o-logique/analog_input.c index 02b0441..abf37dc 100644 --- a/src/glutt-o-logique/analog_input.c +++ b/src/glutt-o-logique/analog_input.c @@ -82,9 +82,8 @@ float analog_measure_12v(void) // Voltage divider 22k / (82k + 22k) must be inverted here // Also, we round to steps of 0.5 - float temp = raw_value * (2.0f * 104.0f / 22.0f); - temp = roundf(temp); - temp = sqrtf(temp); - temp = temp / 2.0f; - return temp; + float voltage = raw_value * (2.0f * 104.0f / 22.0f); + voltage = roundf(voltage); + voltage = voltage / 2.0f; + return voltage; } |