Skip to content

Commit 67474db

Browse files
sumitbatra-nxpfabiobaltieri
authored andcommitted
drivers: sensor: qdec_s32k: fix double promotion warning
Fixing this "revealed" bug which got introduced when a PR added the -Wdouble-promotion flag to GCC builds Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
1 parent 70809cc commit 67474db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/sensor/qdec_nxp_s32/qdec_nxp_s32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct qdec_s32_data {
5757
uint32_t counter_CW;
5858
uint32_t counter_CCW;
5959
int32_t abs_counter;
60-
float micro_ticks_per_rev;
60+
double micro_ticks_per_rev;
6161
uint32_t ticks_per_sec;
6262
uint32_t emios_cw_overflow_count;
6363
uint32_t emios_ccw_overflow_count;
@@ -423,7 +423,7 @@ static int qdec_s32_initialize(const struct device *dev)
423423
#define QDEC_NXP_S32_INIT(n) \
424424
\
425425
static struct qdec_s32_data qdec_s32_##n##_data = { \
426-
.micro_ticks_per_rev = (float)(DT_INST_PROP(n, micro_ticks_per_rev) / 1000000), \
426+
.micro_ticks_per_rev = (double)(DT_INST_PROP(n, micro_ticks_per_rev) / 1000000),\
427427
.counter_CW = 1, \
428428
.counter_CCW = 1, \
429429
}; \

0 commit comments

Comments
 (0)