Skip to content

Commit ef21419

Browse files
kartbenjhedberg
authored andcommitted
drivers: sensor: ti_hdc302x: Fix double-promotion warnings
Change HDC_302X_TEMP_OFFSET_SCALE and HDC_302X_HUMIDITY_OFFSET_SCALE from float literals to double literals to avoid implicit conversion warnings when compiling with clang and -Wdouble-promotion flag. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 76b510c commit ef21419

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/sensor/ti/ti_hdc302x/ti_hdc302x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ static const uint8_t alert_read_commands[][2] = {
8181
#define HDC_302X_TEMP_OFFSET -45
8282
#define HDC_302X_TEMP_SCALE 175U
8383
/* Temperature offset: 7-bit value, max ±21.704101°C, 0.1708984375°C per bit */
84-
#define HDC_302X_TEMP_OFFSET_SCALE 170.8984375f
84+
#define HDC_302X_TEMP_OFFSET_SCALE 170.8984375
8585
/* Humidity offset: 7-bit value, max ±24.8046875%, 0.1953125% per bit */
86-
#define HDC_302X_HUMIDITY_OFFSET_SCALE 19.53125f
86+
#define HDC_302X_HUMIDITY_OFFSET_SCALE 19.53125
8787
/* EEPROM write timeout in milliseconds (53–77 ms, use 80 ms to be safe) */
8888
#define HDC_302X_EEPROM_WRITE_TIME_OUT 80
8989

0 commit comments

Comments
 (0)