Skip to content

Commit

Permalink
drivers: rpi_pico_pwm: Fix compilation warnings
Browse files Browse the repository at this point in the history
return value of pwm_rpi_get_clkdiv contains implicit conversions
from 'float' to 'double', triggered by floating-point operations
involving mixed data types.

Signed-off-by: Jannis Ruellmann <[email protected]>
  • Loading branch information
Jannis Ruellmann authored and fabiobaltieri committed Feb 5, 2024
1 parent b9056de commit 1d9441c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm_rpi_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static float pwm_rpi_get_clkdiv(const struct device *dev, int slice)

/* the divider is a fixed point 8.4 convert to float for use in pico-sdk */
return (float)cfg->slice_configs[slice].integral +
(float)cfg->slice_configs[slice].frac / 16.0;
(float)cfg->slice_configs[slice].frac / 16.0f;
}

static inline uint32_t pwm_rpi_channel_to_slice(uint32_t channel)
Expand Down

0 comments on commit 1d9441c

Please sign in to comment.