aboutsummaryrefslogtreecommitdiffstats
path: root/src/glutt-o-logique/analog_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glutt-o-logique/analog_input.c')
-rw-r--r--src/glutt-o-logique/analog_input.c9
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;
}