Temp conversion was simpler, but not right for negativ values ... fixed
authorNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 12 Aug 2013 19:49:10 +0000 (21:49 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/temp.c

index 1e89cd5..7cb49be 100644 (file)
@@ -89,7 +89,7 @@ int probe_sensor(void)
  */
 int convert_to_deci_degrees(uint16_t raw)
 {
-       return (((int)raw * 10) >> 8); 
+       return (((int16_t)raw * 10) >> 8); 
 }
 
 /* Temp Read