Commits

tswaehn committed 7670cb1

fix: HYT371 temperature values should be signed instead of unsigned

  • Participants
  • Parent commits 8e804a3
  • Branches testing

Comments (0)

Files changed (2)

File drivers/HYT_371.c

 	sHYT371 ret = {0,0};
 
 	unsigned int rH_int;
-	unsigned int T_int;
+	signed int T_int;
 
         // generate new sensor value
 	devicePresent = I2C_sendAddr( sensorAddr, 0 );
 		received raw values (see datasheet)
 	*/
 	rH_int = ((unsigned int)byte0<<8) | byte1;
-	T_int = ((unsigned int) byte2<<8)| (byte3) ;
+	T_int = ((signed int) byte2<<8)| (byte3) ;
         
         #if HYT371_NORMAL_MODE == 1
         T_int = T_int >> 2;

File drivers/HYT_371.h

 */
 typedef struct  {
 	uint16 rH_int;
-	uint16 T_int;
+	sint16 T_int;
 } sHYT371;
 
 #if HYT371_WITH_SENSOR_CONFIGURATION > 0