Commit 59584857 authored by Pali Rohár's avatar Pali Rohár Committed by Anton Vorontsov

rx51_battery: Fix reporting temperature

This patch fixing units (1/10 °C) in which is temperature reported.
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarAnton Vorontsov <anton@enomsg.org>
parent 0bbb06ed
...@@ -119,7 +119,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di) ...@@ -119,7 +119,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
/* First check for temperature in first direct table */ /* First check for temperature in first direct table */
if (raw < ARRAY_SIZE(rx51_temp_table1)) if (raw < ARRAY_SIZE(rx51_temp_table1))
return rx51_temp_table1[raw] * 100; return rx51_temp_table1[raw] * 10;
/* Binary search RAW value in second inverse table */ /* Binary search RAW value in second inverse table */
while (max - min > 1) { while (max - min > 1) {
...@@ -132,7 +132,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di) ...@@ -132,7 +132,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
break; break;
} }
return (rx51_temp_table2_first - min) * 100; return (rx51_temp_table2_first - min) * 10;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment